Merge "Remove InheritedChannel"
diff --git a/JavaLibrary.mk b/JavaLibrary.mk
index 65fc39d..470484e 100644
--- a/JavaLibrary.mk
+++ b/JavaLibrary.mk
@@ -134,7 +134,7 @@
# A library that exists to satisfy javac when
# compiling source code that contains lambdas.
include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(openjdk_lambda_stub_files)
+LOCAL_SRC_FILES := $(openjdk_lambda_stub_files) $(openjdk_lambda_duplicate_stub_files)
LOCAL_NO_STANDARD_LIBRARIES := true
LOCAL_JAVACFLAGS := $(local_javac_flags)
LOCAL_MODULE_TAGS := optional
@@ -318,7 +318,7 @@
# A library that exists to satisfy javac when
# compiling source code that contains lambdas.
include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(openjdk_lambda_stub_files)
+LOCAL_SRC_FILES := $(openjdk_lambda_stub_files) $(openjdk_lambda_duplicate_stub_files)
LOCAL_NO_STANDARD_LIBRARIES := true
LOCAL_JAVACFLAGS := $(local_javac_flags)
LOCAL_MODULE_TAGS := optional
diff --git a/luni/src/main/java/android/system/Os.java b/luni/src/main/java/android/system/Os.java
index c43c1ba..63246d6 100644
--- a/luni/src/main/java/android/system/Os.java
+++ b/luni/src/main/java/android/system/Os.java
@@ -466,7 +466,12 @@
/** @hide */ public static void setsockoptByte(FileDescriptor fd, int level, int option, int value) throws ErrnoException { Libcore.os.setsockoptByte(fd, level, option, value); }
/** @hide */ public static void setsockoptIfreq(FileDescriptor fd, int level, int option, String value) throws ErrnoException { Libcore.os.setsockoptIfreq(fd, level, option, value); }
- /** @hide */ public static void setsockoptInt(FileDescriptor fd, int level, int option, int value) throws ErrnoException { Libcore.os.setsockoptInt(fd, level, option, value); }
+
+ /**
+ * See <a href="http://man7.org/linux/man-pages/man2/setsockopt.2.html">setsockopt(2)</a>.
+ */
+ public static void setsockoptInt(FileDescriptor fd, int level, int option, int value) throws ErrnoException { Libcore.os.setsockoptInt(fd, level, option, value); }
+
/** @hide */ public static void setsockoptIpMreqn(FileDescriptor fd, int level, int option, int value) throws ErrnoException { Libcore.os.setsockoptIpMreqn(fd, level, option, value); }
/** @hide */ public static void setsockoptGroupReq(FileDescriptor fd, int level, int option, StructGroupReq value) throws ErrnoException { Libcore.os.setsockoptGroupReq(fd, level, option, value); }
/** @hide */ public static void setsockoptGroupSourceReq(FileDescriptor fd, int level, int option, StructGroupSourceReq value) throws ErrnoException { Libcore.os.setsockoptGroupSourceReq(fd, level, option, value); }
diff --git a/luni/src/main/java/android/system/OsConstants.java b/luni/src/main/java/android/system/OsConstants.java
index 31f84e9..140d71d 100644
--- a/luni/src/main/java/android/system/OsConstants.java
+++ b/luni/src/main/java/android/system/OsConstants.java
@@ -495,6 +495,7 @@
public static final int S_IXOTH = placeholder();
public static final int S_IXUSR = placeholder();
public static final int TCP_NODELAY = placeholder();
+ public static final int TCP_USER_TIMEOUT = placeholder();
/** @hide */ public static final int TIOCOUTQ = placeholder();
/** @hide */ public static final int UNIX_PATH_MAX = placeholder();
public static final int WCONTINUED = placeholder();
diff --git a/luni/src/main/java/java/net/DefaultFileNameMap.java b/luni/src/main/java/java/net/DefaultFileNameMap.java
index 2f254d9..6222d75 100644
--- a/luni/src/main/java/java/net/DefaultFileNameMap.java
+++ b/luni/src/main/java/java/net/DefaultFileNameMap.java
@@ -37,6 +37,6 @@
if (firstCharInExtension > filename.lastIndexOf('/')) {
ext = filename.substring(firstCharInExtension, lastCharInExtension);
}
- return MimeUtils.guessMimeTypeFromExtension(ext.toLowerCase(Locale.US));
+ return MimeUtils.guessMimeTypeFromExtension(ext);
}
}
diff --git a/luni/src/main/java/libcore/net/MimeUtils.java b/luni/src/main/java/libcore/net/MimeUtils.java
index 3b59b87..58afdf9 100644
--- a/luni/src/main/java/libcore/net/MimeUtils.java
+++ b/luni/src/main/java/libcore/net/MimeUtils.java
@@ -17,6 +17,7 @@
package libcore.net;
import java.util.HashMap;
+import java.util.Locale;
import java.util.Map;
/**
@@ -407,52 +408,52 @@
}
/**
- * Returns true if the given MIME type has an entry in the map.
+ * Returns true if the given case insensitive MIME type has an entry in the map.
* @param mimeType A MIME type (i.e. text/plain)
- * @return True iff there is a mimeType entry in the map.
+ * @return True if a extension has been registered for
+ * the given case insensitive MIME type.
*/
public static boolean hasMimeType(String mimeType) {
- if (mimeType == null || mimeType.isEmpty()) {
- return false;
- }
- return mimeTypeToExtensionMap.containsKey(mimeType);
+ return (guessExtensionFromMimeType(mimeType) != null);
}
/**
- * Returns the MIME type for the given extension.
+ * Returns the MIME type for the given case insensitive file extension.
* @param extension A file extension without the leading '.'
- * @return The MIME type for the given extension or null iff there is none.
+ * @return The MIME type has been registered for
+ * the given case insensitive file extension or null if there is none.
*/
public static String guessMimeTypeFromExtension(String extension) {
if (extension == null || extension.isEmpty()) {
return null;
}
+ extension = extension.toLowerCase(Locale.US);
return extensionToMimeTypeMap.get(extension);
}
/**
- * Returns true if the given extension has a registered MIME type.
+ * Returns true if the given case insensitive extension has a registered MIME type.
* @param extension A file extension without the leading '.'
- * @return True iff there is an extension entry in the map.
+ * @return True if a MIME type has been registered for
+ * the given case insensitive file extension.
*/
public static boolean hasExtension(String extension) {
- if (extension == null || extension.isEmpty()) {
- return false;
- }
- return extensionToMimeTypeMap.containsKey(extension);
+ return (guessMimeTypeFromExtension(extension) != null);
}
/**
- * Returns the registered extension for the given MIME type. Note that some
+ * Returns the registered extension for the given case insensitive MIME type. Note that some
* MIME types map to multiple extensions. This call will return the most
* common extension for the given MIME type.
* @param mimeType A MIME type (i.e. text/plain)
- * @return The extension for the given MIME type or null iff there is none.
+ * @return The extension has been registered for
+ * the given case insensitive MIME type or null if there is none.
*/
public static String guessExtensionFromMimeType(String mimeType) {
if (mimeType == null || mimeType.isEmpty()) {
return null;
}
+ mimeType = mimeType.toLowerCase(Locale.US);
return mimeTypeToExtensionMap.get(mimeType);
}
}
diff --git a/luni/src/main/native/NetworkUtilities.cpp b/luni/src/main/native/NetworkUtilities.cpp
index b285a01..bf438fa 100644
--- a/luni/src/main/native/NetworkUtilities.cpp
+++ b/luni/src/main/native/NetworkUtilities.cpp
@@ -140,8 +140,12 @@
jbyte* dst = reinterpret_cast<jbyte*>(&sin6.sin6_addr.s6_addr);
env->GetByteArrayRegion(addressBytes.get(), 0, 16, dst);
// ...and set the scope id...
- static jfieldID scopeFid = env->GetFieldID(JniConstants::inet6AddressClass, "scope_id", "I");
- sin6.sin6_scope_id = env->GetIntField(inetAddress, scopeFid);
+ static jfieldID holder6Fid = env->GetFieldID(JniConstants::inet6AddressClass,
+ "holder6",
+ "Ljava/net/Inet6Address$Inet6AddressHolder;");
+ ScopedLocalRef<jobject> holder6(env, env->GetObjectField(inetAddress, holder6Fid));
+ static jfieldID scopeFid = env->GetFieldID(JniConstants::inet6AddressHolderClass, "scope_id", "I");
+ sin6.sin6_scope_id = env->GetIntField(holder6.get(), scopeFid);
sa_len = sizeof(sockaddr_in6);
return true;
}
diff --git a/luni/src/main/native/Register.cpp b/luni/src/main/native/Register.cpp
index b099a4e..5fd4a7d 100644
--- a/luni/src/main/native/Register.cpp
+++ b/luni/src/main/native/Register.cpp
@@ -35,6 +35,7 @@
#define REGISTER(FN) extern void FN(JNIEnv*); FN(env)
REGISTER(register_android_system_OsConstants);
// REGISTER(register_java_lang_StringToReal);
+ REGISTER(register_java_lang_invoke_MethodHandle);
REGISTER(register_java_math_NativeBN);
REGISTER(register_java_util_regex_Matcher);
REGISTER(register_java_util_regex_Pattern);
diff --git a/luni/src/main/native/android_system_OsConstants.cpp b/luni/src/main/native/android_system_OsConstants.cpp
index 1293fe7..e6aff37 100644
--- a/luni/src/main/native/android_system_OsConstants.cpp
+++ b/luni/src/main/native/android_system_OsConstants.cpp
@@ -551,6 +551,9 @@
initConstant(env, c, "S_IXOTH", S_IXOTH);
initConstant(env, c, "S_IXUSR", S_IXUSR);
initConstant(env, c, "TCP_NODELAY", TCP_NODELAY);
+#if defined(TCP_USER_TIMEOUT)
+ initConstant(env, c, "TCP_USER_TIMEOUT", TCP_USER_TIMEOUT);
+#endif
initConstant(env, c, "TIOCOUTQ", TIOCOUTQ);
// UNIX_PATH_MAX is mentioned in some versions of unix(7), but not actually declared.
initConstant(env, c, "UNIX_PATH_MAX", sizeof(sockaddr_un::sun_path));
diff --git a/luni/src/main/native/java_lang_invoke_MethodHandle.cpp b/luni/src/main/native/java_lang_invoke_MethodHandle.cpp
new file mode 100644
index 0000000..4596b42
--- /dev/null
+++ b/luni/src/main/native/java_lang_invoke_MethodHandle.cpp
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "JniConstants.h"
+#include "JNIHelp.h"
+
+static void MethodHandle_invokeExact(JNIEnv* env, jobject, jobjectArray) {
+ jniThrowException(env, "java/lang/UnsupportedOperationException",
+ "MethodHandle.invokeExact cannot be invoked reflectively.");
+}
+
+static void MethodHandle_invoke(JNIEnv* env, jobject, jobjectArray) {
+ jniThrowException(env, "java/lang/UnsupportedOperationException",
+ "MethodHandle.invoke cannot be invoked reflectively.");
+}
+
+static JNINativeMethod gMethods[] = {
+ NATIVE_METHOD(MethodHandle, invokeExact, "([Ljava/lang/Object;)Ljava/lang/Object;"),
+ NATIVE_METHOD(MethodHandle, invoke, "([Ljava/lang/Object;)Ljava/lang/Object;"),
+};
+
+void register_java_lang_invoke_MethodHandle(JNIEnv* env) {
+ jniRegisterNativeMethods(env, "java/lang/invoke/MethodHandle", gMethods, NELEM(gMethods));
+}
diff --git a/luni/src/main/native/sub.mk b/luni/src/main/native/sub.mk
index 0efbef6..fbba3b6 100644
--- a/luni/src/main/native/sub.mk
+++ b/luni/src/main/native/sub.mk
@@ -14,6 +14,7 @@
canonicalize_path.cpp \
cbigint.cpp \
java_lang_StringToReal.cpp \
+ java_lang_invoke_MethodHandle.cpp \
java_math_NativeBN.cpp \
java_util_regex_Matcher.cpp \
java_util_regex_Pattern.cpp \
diff --git a/luni/src/test/java/libcore/android/system/OsConstantsTest.java b/luni/src/test/java/libcore/android/system/OsConstantsTest.java
index 080464d..a98707c 100644
--- a/luni/src/test/java/libcore/android/system/OsConstantsTest.java
+++ b/luni/src/test/java/libcore/android/system/OsConstantsTest.java
@@ -30,4 +30,9 @@
assertTrue(OsConstants.IFA_F_TENTATIVE > 0);
}
+
+ // introduced for http://b/30402085
+ public void testTcpUserTimeoutIsDefined() {
+ assertTrue(OsConstants.TCP_USER_TIMEOUT > 0);
+ }
}
diff --git a/luni/src/test/java/libcore/io/OsTest.java b/luni/src/test/java/libcore/io/OsTest.java
index 5a2b95c..f34d099 100644
--- a/luni/src/test/java/libcore/io/OsTest.java
+++ b/luni/src/test/java/libcore/io/OsTest.java
@@ -571,6 +571,39 @@
}
}
+ /**
+ * Tests that TCP_USER_TIMEOUT can be set on a TCP socket, but doesn't test
+ * that it behaves as expected.
+ */
+ public void test_socket_tcpUserTimeout_setAndGet() throws Exception {
+ final FileDescriptor fd = Libcore.os.socket(AF_INET, SOCK_STREAM, 0);
+ try {
+ int v = Libcore.os.getsockoptInt(fd, OsConstants.IPPROTO_TCP, OsConstants.TCP_USER_TIMEOUT);
+ assertEquals(0, v); // system default value
+ int newValue = 3000;
+ Libcore.os.setsockoptInt(fd, OsConstants.IPPROTO_TCP, OsConstants.TCP_USER_TIMEOUT,
+ newValue);
+ assertEquals(newValue, Libcore.os.getsockoptInt(fd, OsConstants.IPPROTO_TCP,
+ OsConstants.TCP_USER_TIMEOUT));
+ // No need to reset the value to 0, since we're throwing the socket away
+ } finally {
+ Libcore.os.close(fd);
+ }
+ }
+
+ public void test_socket_tcpUserTimeout_doesNotWorkOnDatagramSocket() throws Exception {
+ final FileDescriptor fd = Libcore.os.socket(AF_INET, SOCK_DGRAM, 0);
+ try {
+ Libcore.os.setsockoptInt(fd, OsConstants.IPPROTO_TCP, OsConstants.TCP_USER_TIMEOUT,
+ 3000);
+ fail("datagram (connectionless) sockets shouldn't support TCP_USER_TIMEOUT");
+ } catch (ErrnoException expected) {
+ // expected
+ } finally {
+ Libcore.os.close(fd);
+ }
+ }
+
private static void assertStartsWith(byte[] expectedContents, byte[] container) {
for (int i = 0; i < expectedContents.length; i++) {
if (expectedContents[i] != container[i]) {
diff --git a/luni/src/test/java/libcore/java/security/MessageDigestTest.java b/luni/src/test/java/libcore/java/security/MessageDigestTest.java
index 60dc36a..1a00af4 100644
--- a/luni/src/test/java/libcore/java/security/MessageDigestTest.java
+++ b/luni/src/test/java/libcore/java/security/MessageDigestTest.java
@@ -307,4 +307,10 @@
assertEquals(Collections.EMPTY_LIST, methodsNotOverridden);
}
+
+ public void testIsEqual_nullValues() {
+ assertTrue(MessageDigest.isEqual(null, null));
+ assertFalse(MessageDigest.isEqual(null, new byte[1]));
+ assertFalse(MessageDigest.isEqual(new byte[1], null));
+ }
}
diff --git a/luni/src/test/java/libcore/net/MimeUtilsTest.java b/luni/src/test/java/libcore/net/MimeUtilsTest.java
index ff22632..156c9c4 100644
--- a/luni/src/test/java/libcore/net/MimeUtilsTest.java
+++ b/luni/src/test/java/libcore/net/MimeUtilsTest.java
@@ -52,4 +52,23 @@
public void test_18390752() {
assertEquals("jpg", MimeUtils.guessExtensionFromMimeType("image/jpeg"));
}
+
+ public void test_30207891() {
+ assertTrue(MimeUtils.hasMimeType("IMAGE/PNG"));
+ assertTrue(MimeUtils.hasMimeType("IMAGE/png"));
+ assertFalse(MimeUtils.hasMimeType(""));
+ assertEquals("png", MimeUtils.guessExtensionFromMimeType("IMAGE/PNG"));
+ assertEquals("png", MimeUtils.guessExtensionFromMimeType("IMAGE/png"));
+ assertNull(MimeUtils.guessMimeTypeFromExtension(""));
+ assertNull(MimeUtils.guessMimeTypeFromExtension("doesnotexist"));
+ assertTrue(MimeUtils.hasExtension("PNG"));
+ assertTrue(MimeUtils.hasExtension("PnG"));
+ assertFalse(MimeUtils.hasExtension(""));
+ assertFalse(MimeUtils.hasExtension(".png"));
+ assertEquals("image/png", MimeUtils.guessMimeTypeFromExtension("PNG"));
+ assertEquals("image/png", MimeUtils.guessMimeTypeFromExtension("PnG"));
+ assertNull(MimeUtils.guessMimeTypeFromExtension(".png"));
+ assertNull(MimeUtils.guessMimeTypeFromExtension(""));
+ assertNull(MimeUtils.guessExtensionFromMimeType("doesnotexist"));
+ }
}
diff --git a/luni/src/test/resources/serialization/org/apache/harmony/regex/tests/java/util/regex/PatternSyntaxExceptionTest.golden.ser b/luni/src/test/resources/serialization/org/apache/harmony/regex/tests/java/util/regex/PatternSyntaxExceptionTest.golden.ser
old mode 100755
new mode 100644
Binary files differ
diff --git a/luni/src/test/resources/serialization/org/apache/harmony/regex/tests/java/util/regex/PatternTest.golden.ser b/luni/src/test/resources/serialization/org/apache/harmony/regex/tests/java/util/regex/PatternTest.golden.ser
old mode 100755
new mode 100644
Binary files differ
diff --git a/ojluni/src/lambda/java/java/lang/invoke/LambdaConversionException.java b/ojluni/src/lambda/java/java/lang/invoke/LambdaConversionException.java
new file mode 100644
index 0000000..e1123da
--- /dev/null
+++ b/ojluni/src/lambda/java/java/lang/invoke/LambdaConversionException.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang.invoke;
+
+/**
+ * LambdaConversionException
+ */
+public class LambdaConversionException extends Exception {
+ private static final long serialVersionUID = 292L + 8L;
+
+ /**
+ * Constructs a {@code LambdaConversionException}.
+ */
+ public LambdaConversionException() {
+ }
+
+ /**
+ * Constructs a {@code LambdaConversionException} with a message.
+ * @param message the detail message
+ */
+ public LambdaConversionException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a {@code LambdaConversionException} with a message and cause.
+ * @param message the detail message
+ * @param cause the cause
+ */
+ public LambdaConversionException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Constructs a {@code LambdaConversionException} with a cause.
+ * @param cause the cause
+ */
+ public LambdaConversionException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Constructs a {@code LambdaConversionException} with a message,
+ * cause, and other settings.
+ * @param message the detail message
+ * @param cause the cause
+ * @param enableSuppression whether or not suppressed exceptions are enabled
+ * @param writableStackTrace whether or not the stack trace is writable
+ */
+ public LambdaConversionException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+ super(message, cause, enableSuppression, writableStackTrace);
+ }
+}
diff --git a/ojluni/src/lambda/java/java/lang/invoke/MethodType.java b/ojluni/src/lambda/java/java/lang/invoke/MethodType.java
new file mode 100644
index 0000000..4cb5c22
--- /dev/null
+++ b/ojluni/src/lambda/java/java/lang/invoke/MethodType.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang.invoke;
+
+import java.util.List;
+
+public final
+class MethodType implements java.io.Serializable {
+
+ public static
+ MethodType methodType(Class<?> rtype, Class<?>[] ptypes) {
+ return null;
+ }
+
+ public static
+ MethodType methodType(Class<?> rtype, List<Class<?>> ptypes) {
+ return null;
+ }
+
+ public static
+ MethodType methodType(Class<?> rtype, Class<?> ptype0, Class<?>... ptypes) { return null; }
+
+ public static
+ MethodType methodType(Class<?> rtype) { return null; }
+
+ public static
+ MethodType methodType(Class<?> rtype, Class<?> ptype0) { return null; }
+
+ public static
+ MethodType methodType(Class<?> rtype, MethodType ptypes) { return null; }
+
+ public static
+ MethodType genericMethodType(int objectArgCount, boolean finalArray) { return null; }
+
+ public static
+ MethodType genericMethodType(int objectArgCount) { return null; }
+
+ public MethodType changeParameterType(int num, Class<?> nptype) { return null; }
+
+ public MethodType insertParameterTypes(int num, Class<?>... ptypesToInsert) { return null; }
+
+ public MethodType appendParameterTypes(Class<?>... ptypesToInsert) { return null; }
+
+ public MethodType insertParameterTypes(int num, List<Class<?>> ptypesToInsert) { return null; }
+
+ public MethodType appendParameterTypes(List<Class<?>> ptypesToInsert) { return null; }
+
+ public MethodType dropParameterTypes(int start, int end) { return null; }
+
+ public MethodType changeReturnType(Class<?> nrtype) { return null; }
+
+ public boolean hasPrimitives() { return false; }
+
+ public boolean hasWrappers() { return false; }
+
+ public MethodType erase() { return null; }
+
+ public MethodType generic() { return null; }
+
+ public MethodType wrap() { return null; }
+
+ public MethodType unwrap() { return null; }
+
+ public Class<?> parameterType(int num) { return null; }
+
+ public int parameterCount() { return 0; }
+
+ public Class<?> returnType() { return null; }
+
+ public List<Class<?>> parameterList() { return null; }
+
+ public Class<?>[] parameterArray() { return null; }
+
+ public static MethodType fromMethodDescriptorString(String descriptor, ClassLoader loader)
+ throws IllegalArgumentException, TypeNotPresentException { return null; }
+
+ public String toMethodDescriptorString() { return null; }
+
+}
diff --git a/ojluni/src/main/java/java/io/DataInputStream.java b/ojluni/src/main/java/java/io/DataInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/package.html b/ojluni/src/main/java/java/io/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/Runtime.java b/ojluni/src/main/java/java/lang/Runtime.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/invoke/MethodHandle.java b/ojluni/src/main/java/java/lang/invoke/MethodHandle.java
new file mode 100644
index 0000000..ffbc401
--- /dev/null
+++ b/ojluni/src/main/java/java/lang/invoke/MethodHandle.java
@@ -0,0 +1,1301 @@
+/*
+ * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang.invoke;
+
+
+import java.util.*;
+
+import static java.lang.invoke.MethodHandleStatics.*;
+
+/**
+ * A method handle is a typed, directly executable reference to an underlying method,
+ * constructor, field, or similar low-level operation, with optional
+ * transformations of arguments or return values.
+ * These transformations are quite general, and include such patterns as
+ * {@linkplain #asType conversion},
+ * {@linkplain #bindTo insertion},
+ * {@code java.lang.invoke.MethodHandles#dropArguments deletion},
+ * and {@code java.lang.invoke.MethodHandles#filterArguments substitution}.
+ *
+ * <h1>Method handle contents</h1>
+ * Method handles are dynamically and strongly typed according to their parameter and return types.
+ * They are not distinguished by the name or the defining class of their underlying methods.
+ * A method handle must be invoked using a symbolic type descriptor which matches
+ * the method handle's own {@linkplain #type type descriptor}.
+ * <p>
+ * Every method handle reports its type descriptor via the {@link #type type} accessor.
+ * This type descriptor is a {@link java.lang.invoke.MethodType MethodType} object,
+ * whose structure is a series of classes, one of which is
+ * the return type of the method (or {@code void.class} if none).
+ * <p>
+ * A method handle's type controls the types of invocations it accepts,
+ * and the kinds of transformations that apply to it.
+ * <p>
+ * A method handle contains a pair of special invoker methods
+ * called {@link #invokeExact invokeExact} and {@link #invoke invoke}.
+ * Both invoker methods provide direct access to the method handle's
+ * underlying method, constructor, field, or other operation,
+ * as modified by transformations of arguments and return values.
+ * Both invokers accept calls which exactly match the method handle's own type.
+ * The plain, inexact invoker also accepts a range of other call types.
+ * <p>
+ * Method handles are immutable and have no visible state.
+ * Of course, they can be bound to underlying methods or data which exhibit state.
+ * With respect to the Java Memory Model, any method handle will behave
+ * as if all of its (internal) fields are final variables. This means that any method
+ * handle made visible to the application will always be fully formed.
+ * This is true even if the method handle is published through a shared
+ * variable in a data race.
+ * <p>
+ * Method handles cannot be subclassed by the user.
+ * Implementations may (or may not) create internal subclasses of {@code MethodHandle}
+ * which may be visible via the {@link java.lang.Object#getClass Object.getClass}
+ * operation. The programmer should not draw conclusions about a method handle
+ * from its specific class, as the method handle class hierarchy (if any)
+ * may change from time to time or across implementations from different vendors.
+ *
+ * <h1>Method handle compilation</h1>
+ * A Java method call expression naming {@code invokeExact} or {@code invoke}
+ * can invoke a method handle from Java source code.
+ * From the viewpoint of source code, these methods can take any arguments
+ * and their result can be cast to any return type.
+ * Formally this is accomplished by giving the invoker methods
+ * {@code Object} return types and variable arity {@code Object} arguments,
+ * but they have an additional quality called <em>signature polymorphism</em>
+ * which connects this freedom of invocation directly to the JVM execution stack.
+ * <p>
+ * As is usual with virtual methods, source-level calls to {@code invokeExact}
+ * and {@code invoke} compile to an {@code invokevirtual} instruction.
+ * More unusually, the compiler must record the actual argument types,
+ * and may not perform method invocation conversions on the arguments.
+ * Instead, it must push them on the stack according to their own unconverted types.
+ * The method handle object itself is pushed on the stack before the arguments.
+ * The compiler then calls the method handle with a symbolic type descriptor which
+ * describes the argument and return types.
+ * <p>
+ * To issue a complete symbolic type descriptor, the compiler must also determine
+ * the return type. This is based on a cast on the method invocation expression,
+ * if there is one, or else {@code Object} if the invocation is an expression
+ * or else {@code void} if the invocation is a statement.
+ * The cast may be to a primitive type (but not {@code void}).
+ * <p>
+ * As a corner case, an uncasted {@code null} argument is given
+ * a symbolic type descriptor of {@code java.lang.Void}.
+ * The ambiguity with the type {@code Void} is harmless, since there are no references of type
+ * {@code Void} except the null reference.
+ *
+ * <h1>Method handle invocation</h1>
+ * The first time a {@code invokevirtual} instruction is executed
+ * it is linked, by symbolically resolving the names in the instruction
+ * and verifying that the method call is statically legal.
+ * This is true of calls to {@code invokeExact} and {@code invoke}.
+ * In this case, the symbolic type descriptor emitted by the compiler is checked for
+ * correct syntax and names it contains are resolved.
+ * Thus, an {@code invokevirtual} instruction which invokes
+ * a method handle will always link, as long
+ * as the symbolic type descriptor is syntactically well-formed
+ * and the types exist.
+ * <p>
+ * When the {@code invokevirtual} is executed after linking,
+ * the receiving method handle's type is first checked by the JVM
+ * to ensure that it matches the symbolic type descriptor.
+ * If the type match fails, it means that the method which the
+ * caller is invoking is not present on the individual
+ * method handle being invoked.
+ * <p>
+ * In the case of {@code invokeExact}, the type descriptor of the invocation
+ * (after resolving symbolic type names) must exactly match the method type
+ * of the receiving method handle.
+ * In the case of plain, inexact {@code invoke}, the resolved type descriptor
+ * must be a valid argument to the receiver's {@link #asType asType} method.
+ * Thus, plain {@code invoke} is more permissive than {@code invokeExact}.
+ * <p>
+ * After type matching, a call to {@code invokeExact} directly
+ * and immediately invoke the method handle's underlying method
+ * (or other behavior, as the case may be).
+ * <p>
+ * A call to plain {@code invoke} works the same as a call to
+ * {@code invokeExact}, if the symbolic type descriptor specified by the caller
+ * exactly matches the method handle's own type.
+ * If there is a type mismatch, {@code invoke} attempts
+ * to adjust the type of the receiving method handle,
+ * as if by a call to {@link #asType asType},
+ * to obtain an exactly invokable method handle {@code M2}.
+ * This allows a more powerful negotiation of method type
+ * between caller and callee.
+ * <p>
+ * (<em>Note:</em> The adjusted method handle {@code M2} is not directly observable,
+ * and implementations are therefore not required to materialize it.)
+ *
+ * <h1>Invocation checking</h1>
+ * In typical programs, method handle type matching will usually succeed.
+ * But if a match fails, the JVM will throw a {@link WrongMethodTypeException},
+ * either directly (in the case of {@code invokeExact}) or indirectly as if
+ * by a failed call to {@code asType} (in the case of {@code invoke}).
+ * <p>
+ * Thus, a method type mismatch which might show up as a linkage error
+ * in a statically typed program can show up as
+ * a dynamic {@code WrongMethodTypeException}
+ * in a program which uses method handles.
+ * <p>
+ * Because method types contain "live" {@code Class} objects,
+ * method type matching takes into account both types names and class loaders.
+ * Thus, even if a method handle {@code M} is created in one
+ * class loader {@code L1} and used in another {@code L2},
+ * method handle calls are type-safe, because the caller's symbolic type
+ * descriptor, as resolved in {@code L2},
+ * is matched against the original callee method's symbolic type descriptor,
+ * as resolved in {@code L1}.
+ * The resolution in {@code L1} happens when {@code M} is created
+ * and its type is assigned, while the resolution in {@code L2} happens
+ * when the {@code invokevirtual} instruction is linked.
+ * <p>
+ * Apart from the checking of type descriptors,
+ * a method handle's capability to call its underlying method is unrestricted.
+ * If a method handle is formed on a non-public method by a class
+ * that has access to that method, the resulting handle can be used
+ * in any place by any caller who receives a reference to it.
+ * <p>
+ * Unlike with the Core Reflection API, where access is checked every time
+ * a reflective method is invoked,
+ * method handle access checking is performed
+ * <a href="MethodHandles.Lookup.html#access">when the method handle is created</a>.
+ * In the case of {@code ldc} (see below), access checking is performed as part of linking
+ * the constant pool entry underlying the constant method handle.
+ * <p>
+ * Thus, handles to non-public methods, or to methods in non-public classes,
+ * should generally be kept secret.
+ * They should not be passed to untrusted code unless their use from
+ * the untrusted code would be harmless.
+ *
+ * <h1>Method handle creation</h1>
+ * Java code can create a method handle that directly accesses
+ * any method, constructor, or field that is accessible to that code.
+ * This is done via a reflective, capability-based API called
+ * {@code java.lang.invoke.MethodHandles.Lookup MethodHandles.Lookup}
+ * For example, a static method handle can be obtained
+ * from {@code java.lang.invoke.MethodHandles.Lookup#findStatic Lookup.findStatic}.
+ * There are also conversion methods from Core Reflection API objects,
+ * such as {@code java.lang.invoke.MethodHandles.Lookup#unreflect Lookup.unreflect}.
+ * <p>
+ * Like classes and strings, method handles that correspond to accessible
+ * fields, methods, and constructors can also be represented directly
+ * in a class file's constant pool as constants to be loaded by {@code ldc} bytecodes.
+ * A new type of constant pool entry, {@code CONSTANT_MethodHandle},
+ * refers directly to an associated {@code CONSTANT_Methodref},
+ * {@code CONSTANT_InterfaceMethodref}, or {@code CONSTANT_Fieldref}
+ * constant pool entry.
+ * (For full details on method handle constants,
+ * see sections 4.4.8 and 5.4.3.5 of the Java Virtual Machine Specification.)
+ * <p>
+ * Method handles produced by lookups or constant loads from methods or
+ * constructors with the variable arity modifier bit ({@code 0x0080})
+ * have a corresponding variable arity, as if they were defined with
+ * the help of {@link #asVarargsCollector asVarargsCollector}.
+ * <p>
+ * A method reference may refer either to a static or non-static method.
+ * In the non-static case, the method handle type includes an explicit
+ * receiver argument, prepended before any other arguments.
+ * In the method handle's type, the initial receiver argument is typed
+ * according to the class under which the method was initially requested.
+ * (E.g., if a non-static method handle is obtained via {@code ldc},
+ * the type of the receiver is the class named in the constant pool entry.)
+ * <p>
+ * Method handle constants are subject to the same link-time access checks
+ * their corresponding bytecode instructions, and the {@code ldc} instruction
+ * will throw corresponding linkage errors if the bytecode behaviors would
+ * throw such errors.
+ * <p>
+ * As a corollary of this, access to protected members is restricted
+ * to receivers only of the accessing class, or one of its subclasses,
+ * and the accessing class must in turn be a subclass (or package sibling)
+ * of the protected member's defining class.
+ * If a method reference refers to a protected non-static method or field
+ * of a class outside the current package, the receiver argument will
+ * be narrowed to the type of the accessing class.
+ * <p>
+ * When a method handle to a virtual method is invoked, the method is
+ * always looked up in the receiver (that is, the first argument).
+ * <p>
+ * A non-virtual method handle to a specific virtual method implementation
+ * can also be created. These do not perform virtual lookup based on
+ * receiver type. Such a method handle simulates the effect of
+ * an {@code invokespecial} instruction to the same method.
+ *
+ * <h1>Usage examples</h1>
+ * Here are some examples of usage:
+ * <blockquote><pre>{@code
+Object x, y; String s; int i;
+MethodType mt; MethodHandle mh;
+MethodHandles.Lookup lookup = MethodHandles.lookup();
+// mt is (char,char)String
+mt = MethodType.methodType(String.class, char.class, char.class);
+mh = lookup.findVirtual(String.class, "replace", mt);
+s = (String) mh.invokeExact("daddy",'d','n');
+// invokeExact(Ljava/lang/String;CC)Ljava/lang/String;
+assertEquals(s, "nanny");
+// weakly typed invocation (using MHs.invoke)
+s = (String) mh.invokeWithArguments("sappy", 'p', 'v');
+assertEquals(s, "savvy");
+// mt is (Object[])List
+mt = MethodType.methodType(java.util.List.class, Object[].class);
+mh = lookup.findStatic(java.util.Arrays.class, "asList", mt);
+assert(mh.isVarargsCollector());
+x = mh.invoke("one", "two");
+// invoke(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;
+assertEquals(x, java.util.Arrays.asList("one","two"));
+// mt is (Object,Object,Object)Object
+mt = MethodType.genericMethodType(3);
+mh = mh.asType(mt);
+x = mh.invokeExact((Object)1, (Object)2, (Object)3);
+// invokeExact(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
+assertEquals(x, java.util.Arrays.asList(1,2,3));
+// mt is ()int
+mt = MethodType.methodType(int.class);
+mh = lookup.findVirtual(java.util.List.class, "size", mt);
+i = (int) mh.invokeExact(java.util.Arrays.asList(1,2,3));
+// invokeExact(Ljava/util/List;)I
+assert(i == 3);
+mt = MethodType.methodType(void.class, String.class);
+mh = lookup.findVirtual(java.io.PrintStream.class, "println", mt);
+mh.invokeExact(System.out, "Hello, world.");
+// invokeExact(Ljava/io/PrintStream;Ljava/lang/String;)V
+ * }</pre></blockquote>
+ * Each of the above calls to {@code invokeExact} or plain {@code invoke}
+ * generates a single invokevirtual instruction with
+ * the symbolic type descriptor indicated in the following comment.
+ * In these examples, the helper method {@code assertEquals} is assumed to
+ * be a method which calls {@link java.util.Objects#equals(Object,Object) Objects.equals}
+ * on its arguments, and asserts that the result is true.
+ *
+ * <h1>Exceptions</h1>
+ * The methods {@code invokeExact} and {@code invoke} are declared
+ * to throw {@link java.lang.Throwable Throwable},
+ * which is to say that there is no static restriction on what a method handle
+ * can throw. Since the JVM does not distinguish between checked
+ * and unchecked exceptions (other than by their class, of course),
+ * there is no particular effect on bytecode shape from ascribing
+ * checked exceptions to method handle invocations. But in Java source
+ * code, methods which perform method handle calls must either explicitly
+ * throw {@code Throwable}, or else must catch all
+ * throwables locally, rethrowing only those which are legal in the context,
+ * and wrapping ones which are illegal.
+ *
+ * <h1><a name="sigpoly"></a>Signature polymorphism</h1>
+ * The unusual compilation and linkage behavior of
+ * {@code invokeExact} and plain {@code invoke}
+ * is referenced by the term <em>signature polymorphism</em>.
+ * As defined in the Java Language Specification,
+ * a signature polymorphic method is one which can operate with
+ * any of a wide range of call signatures and return types.
+ * <p>
+ * In source code, a call to a signature polymorphic method will
+ * compile, regardless of the requested symbolic type descriptor.
+ * As usual, the Java compiler emits an {@code invokevirtual}
+ * instruction with the given symbolic type descriptor against the named method.
+ * The unusual part is that the symbolic type descriptor is derived from
+ * the actual argument and return types, not from the method declaration.
+ * <p>
+ * When the JVM processes bytecode containing signature polymorphic calls,
+ * it will successfully link any such call, regardless of its symbolic type descriptor.
+ * (In order to retain type safety, the JVM will guard such calls with suitable
+ * dynamic type checks, as described elsewhere.)
+ * <p>
+ * Bytecode generators, including the compiler back end, are required to emit
+ * untransformed symbolic type descriptors for these methods.
+ * Tools which determine symbolic linkage are required to accept such
+ * untransformed descriptors, without reporting linkage errors.
+ *
+ * <h1>Interoperation between method handles and the Core Reflection API</h1>
+ * Using factory methods in the {@code java.lang.invoke.MethodHandles.Lookup Lookup} API,
+ * any class member represented by a Core Reflection API object
+ * can be converted to a behaviorally equivalent method handle.
+ * For example, a reflective {@link java.lang.reflect.Method Method} can
+ * be converted to a method handle using
+ * {@code java.lang.invoke.MethodHandles.Lookup#unreflect Lookup.unreflect}.
+ * The resulting method handles generally provide more direct and efficient
+ * access to the underlying class members.
+ * <p>
+ * As a special case,
+ * when the Core Reflection API is used to view the signature polymorphic
+ * methods {@code invokeExact} or plain {@code invoke} in this class,
+ * they appear as ordinary non-polymorphic methods.
+ * Their reflective appearance, as viewed by
+ * {@link java.lang.Class#getDeclaredMethod Class.getDeclaredMethod},
+ * is unaffected by their special status in this API.
+ * For example, {@link java.lang.reflect.Method#getModifiers Method.getModifiers}
+ * will report exactly those modifier bits required for any similarly
+ * declared method, including in this case {@code native} and {@code varargs} bits.
+ * <p>
+ * As with any reflected method, these methods (when reflected) may be
+ * invoked via {@link java.lang.reflect.Method#invoke java.lang.reflect.Method.invoke}.
+ * However, such reflective calls do not result in method handle invocations.
+ * Such a call, if passed the required argument
+ * (a single one, of type {@code Object[]}), will ignore the argument and
+ * will throw an {@code UnsupportedOperationException}.
+ * <p>
+ * Since {@code invokevirtual} instructions can natively
+ * invoke method handles under any symbolic type descriptor, this reflective view conflicts
+ * with the normal presentation of these methods via bytecodes.
+ * Thus, these two native methods, when reflectively viewed by
+ * {@code Class.getDeclaredMethod}, may be regarded as placeholders only.
+ * <p>
+ * In order to obtain an invoker method for a particular type descriptor,
+ * use {@code java.lang.invoke.MethodHandles#exactInvoker MethodHandles.exactInvoker},
+ * or {@code java.lang.invoke.MethodHandles#invoker MethodHandles.invoker}.
+ * The {@code java.lang.invoke.MethodHandles.Lookup#findVirtual Lookup.findVirtual}
+ * API is also able to return a method handle
+ * to call {@code invokeExact} or plain {@code invoke},
+ * for any specified type descriptor .
+ *
+ * <h1>Interoperation between method handles and Java generics</h1>
+ * A method handle can be obtained on a method, constructor, or field
+ * which is declared with Java generic types.
+ * As with the Core Reflection API, the type of the method handle
+ * will constructed from the erasure of the source-level type.
+ * When a method handle is invoked, the types of its arguments
+ * or the return value cast type may be generic types or type instances.
+ * If this occurs, the compiler will replace those
+ * types by their erasures when it constructs the symbolic type descriptor
+ * for the {@code invokevirtual} instruction.
+ * <p>
+ * Method handles do not represent
+ * their function-like types in terms of Java parameterized (generic) types,
+ * because there are three mismatches between function-like types and parameterized
+ * Java types.
+ * <ul>
+ * <li>Method types range over all possible arities,
+ * from no arguments to up to the <a href="MethodHandle.html#maxarity">maximum number</a> of allowed arguments.
+ * Generics are not variadic, and so cannot represent this.</li>
+ * <li>Method types can specify arguments of primitive types,
+ * which Java generic types cannot range over.</li>
+ * <li>Higher order functions over method handles (combinators) are
+ * often generic across a wide range of function types, including
+ * those of multiple arities. It is impossible to represent such
+ * genericity with a Java type parameter.</li>
+ * </ul>
+ *
+ * <h1><a name="maxarity"></a>Arity limits</h1>
+ * The JVM imposes on all methods and constructors of any kind an absolute
+ * limit of 255 stacked arguments. This limit can appear more restrictive
+ * in certain cases:
+ * <ul>
+ * <li>A {@code long} or {@code double} argument counts (for purposes of arity limits) as two argument slots.
+ * <li>A non-static method consumes an extra argument for the object on which the method is called.
+ * <li>A constructor consumes an extra argument for the object which is being constructed.
+ * <li>Since a method handle’s {@code invoke} method (or other signature-polymorphic method) is non-virtual,
+ * it consumes an extra argument for the method handle itself, in addition to any non-virtual receiver object.
+ * </ul>
+ * These limits imply that certain method handles cannot be created, solely because of the JVM limit on stacked arguments.
+ * For example, if a static JVM method accepts exactly 255 arguments, a method handle cannot be created for it.
+ * Attempts to create method handles with impossible method types lead to an {@link IllegalArgumentException}.
+ * In particular, a method handle’s type must not have an arity of the exact maximum 255.
+ *
+ * @see MethodType
+ * @author John Rose, JSR 292 EG
+ */
+// Android-changed, TODO(narayan): Replace @code with @linkplain once MethodHandles
+// is ready for use.
+// @see MethodHandles
+// Android-changed, TODO(narayan): Bring back @see once the MethodHandles class is ready for use..
+public abstract class MethodHandle {
+ // Android-changed:
+ //
+ // static { MethodHandleImpl.initStatics(); }
+ //
+ // LambdaForm and customizationCount are currently unused in our implementation
+ // and will be substituted with appropriate implementation / delegate classes.
+ //
+ // /*private*/ final LambdaForm form;
+ // form is not private so that invokers can easily fetch it
+ // /*non-public*/ byte customizationCount;
+ // customizationCount should be accessible from invokers
+
+
+ /**
+ * Internal marker interface which distinguishes (to the Java compiler)
+ * those methods which are <a href="MethodHandle.html#sigpoly">signature polymorphic</a>.
+ */
+ @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD})
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
+ @interface PolymorphicSignature { }
+
+ private final MethodType type;
+ /*private*/ MethodHandle asTypeCache;
+ // asTypeCache is not private so that invokers can easily fetch it
+
+ /**
+ * Reports the type of this method handle.
+ * Every invocation of this method handle via {@code invokeExact} must exactly match this type.
+ * @return the method handle type
+ */
+ public MethodType type() {
+ return type;
+ }
+
+ /**
+ * Package-private constructor for the method handle implementation hierarchy.
+ * Method handle inheritance will be contained completely within
+ * the {@code java.lang.invoke} package.
+ */
+ // @param type type (permanently assigned) of the new method handle
+ /*non-public*/ MethodHandle(MethodType type) {
+ type.getClass(); // explicit NPE
+ this.type = type;
+
+ // Android-changed: No LambdaForms associated with this MH.
+ }
+
+ /**
+ * Invokes the method handle, allowing any caller type descriptor, but requiring an exact type match.
+ * The symbolic type descriptor at the call site of {@code invokeExact} must
+ * exactly match this method handle's {@link #type type}.
+ * No conversions are allowed on arguments or return values.
+ * <p>
+ * When this method is observed via the Core Reflection API,
+ * it will appear as a single native method, taking an object array and returning an object.
+ * If this native method is invoked directly via
+ * {@link java.lang.reflect.Method#invoke java.lang.reflect.Method.invoke}, via JNI,
+ * or indirectly via {@code java.lang.invoke.MethodHandles.Lookup#unreflect Lookup.unreflect},
+ * it will throw an {@code UnsupportedOperationException}.
+ * @param args the signature-polymorphic parameter list, statically represented using varargs
+ * @return the signature-polymorphic result, statically represented using {@code Object}
+ * @throws WrongMethodTypeException if the target's type is not identical with the caller's symbolic type descriptor
+ * @throws Throwable anything thrown by the underlying method propagates unchanged through the method handle call
+ */
+ // Android-changed, TODO(narayan): Replace @code with @linkplain once MethodHandles
+ // is ready for use.
+ public final native @PolymorphicSignature Object invokeExact(Object... args) throws Throwable;
+
+ /**
+ * Invokes the method handle, allowing any caller type descriptor,
+ * and optionally performing conversions on arguments and return values.
+ * <p>
+ * If the call site's symbolic type descriptor exactly matches this method handle's {@link #type type},
+ * the call proceeds as if by {@link #invokeExact invokeExact}.
+ * <p>
+ * Otherwise, the call proceeds as if this method handle were first
+ * adjusted by calling {@link #asType asType} to adjust this method handle
+ * to the required type, and then the call proceeds as if by
+ * {@link #invokeExact invokeExact} on the adjusted method handle.
+ * <p>
+ * There is no guarantee that the {@code asType} call is actually made.
+ * If the JVM can predict the results of making the call, it may perform
+ * adaptations directly on the caller's arguments,
+ * and call the target method handle according to its own exact type.
+ * <p>
+ * The resolved type descriptor at the call site of {@code invoke} must
+ * be a valid argument to the receivers {@code asType} method.
+ * In particular, the caller must specify the same argument arity
+ * as the callee's type,
+ * if the callee is not a {@linkplain #asVarargsCollector variable arity collector}.
+ * <p>
+ * When this method is observed via the Core Reflection API,
+ * it will appear as a single native method, taking an object array and returning an object.
+ * If this native method is invoked directly via
+ * {@link java.lang.reflect.Method#invoke java.lang.reflect.Method.invoke}, via JNI,
+ * or indirectly via {@code java.lang.invoke.MethodHandles.Lookup#unreflect Lookup.unreflect},
+ * it will throw an {@code UnsupportedOperationException}.
+ * @param args the signature-polymorphic parameter list, statically represented using varargs
+ * @return the signature-polymorphic result, statically represented using {@code Object}
+ * @throws WrongMethodTypeException if the target's type cannot be adjusted to the caller's symbolic type descriptor
+ * @throws ClassCastException if the target's type can be adjusted to the caller, but a reference cast fails
+ * @throws Throwable anything thrown by the underlying method propagates unchanged through the method handle call
+ */
+ // Android-changed, TODO(narayan): Replace @code with @link once MethodHandles
+ // is ready for use.
+ public final native @PolymorphicSignature Object invoke(Object... args) throws Throwable;
+
+ // Android-changed: Removed implementation details.
+ //
+ // /*non-public*/ final native @PolymorphicSignature Object invokeBasic(Object... args)
+ // /*non-public*/ static native @PolymorphicSignature Object linkToVirtual(Object... args)
+ // /*non-public*/ static native @PolymorphicSignature Object linkToStatic(Object... args)
+ // /*non-public*/ static native @PolymorphicSignature Object linkToSpecial(Object... args)
+ // /*non-public*/ static native @PolymorphicSignature Object linkToInterface(Object... args)
+
+ /**
+ * Performs a variable arity invocation, passing the arguments in the given list
+ * to the method handle, as if via an inexact {@link #invoke invoke} from a call site
+ * which mentions only the type {@code Object}, and whose arity is the length
+ * of the argument list.
+ * <p>
+ * Specifically, execution proceeds as if by the following steps,
+ * although the methods are not guaranteed to be called if the JVM
+ * can predict their effects.
+ * <ul>
+ * <li>Determine the length of the argument array as {@code N}.
+ * For a null reference, {@code N=0}. </li>
+ * <li>Determine the general type {@code TN} of {@code N} arguments as
+ * as {@code TN=MethodType.genericMethodType(N)}.</li>
+ * <li>Force the original target method handle {@code MH0} to the
+ * required type, as {@code MH1 = MH0.asType(TN)}. </li>
+ * <li>Spread the array into {@code N} separate arguments {@code A0, ...}. </li>
+ * <li>Invoke the type-adjusted method handle on the unpacked arguments:
+ * MH1.invokeExact(A0, ...). </li>
+ * <li>Take the return value as an {@code Object} reference. </li>
+ * </ul>
+ * <p>
+ * Because of the action of the {@code asType} step, the following argument
+ * conversions are applied as necessary:
+ * <ul>
+ * <li>reference casting
+ * <li>unboxing
+ * <li>widening primitive conversions
+ * </ul>
+ * <p>
+ * The result returned by the call is boxed if it is a primitive,
+ * or forced to null if the return type is void.
+ * <p>
+ * This call is equivalent to the following code:
+ * <blockquote><pre>{@code
+ * MethodHandle invoker = MethodHandles.spreadInvoker(this.type(), 0);
+ * Object result = invoker.invokeExact(this, arguments);
+ * }</pre></blockquote>
+ * <p>
+ * Unlike the signature polymorphic methods {@code invokeExact} and {@code invoke},
+ * {@code invokeWithArguments} can be accessed normally via the Core Reflection API and JNI.
+ * It can therefore be used as a bridge between native or reflective code and method handles.
+ *
+ * @param arguments the arguments to pass to the target
+ * @return the result returned by the target
+ * @throws ClassCastException if an argument cannot be converted by reference casting
+ * @throws WrongMethodTypeException if the target's type cannot be adjusted to take the given number of {@code Object} arguments
+ * @throws Throwable anything thrown by the target method invocation
+ */
+ // @see MethodHandles#spreadInvoker
+ // Android-changed, TODO(narayan): Bring back @see once the MethodHandles class is ready for use.
+ public Object invokeWithArguments(Object... arguments) throws Throwable {
+ // TODO(narayan): Implement invokeWithArguments.
+ throw new UnsupportedOperationException("invokeWithArguments(Object...)");
+ }
+
+ /**
+ * Performs a variable arity invocation, passing the arguments in the given array
+ * to the method handle, as if via an inexact {@link #invoke invoke} from a call site
+ * which mentions only the type {@code Object}, and whose arity is the length
+ * of the argument array.
+ * <p>
+ * This method is also equivalent to the following code:
+ * <blockquote><pre>{@code
+ * invokeWithArguments(arguments.toArray()
+ * }</pre></blockquote>
+ *
+ * @param arguments the arguments to pass to the target
+ * @return the result returned by the target
+ * @throws NullPointerException if {@code arguments} is a null reference
+ * @throws ClassCastException if an argument cannot be converted by reference casting
+ * @throws WrongMethodTypeException if the target's type cannot be adjusted to take the given number of {@code Object} arguments
+ * @throws Throwable anything thrown by the target method invocation
+ */
+ public Object invokeWithArguments(java.util.List<?> arguments) throws Throwable {
+ return invokeWithArguments(arguments.toArray());
+ }
+
+ /**
+ * Produces an adapter method handle which adapts the type of the
+ * current method handle to a new type.
+ * The resulting method handle is guaranteed to report a type
+ * which is equal to the desired new type.
+ * <p>
+ * If the original type and new type are equal, returns {@code this}.
+ * <p>
+ * The new method handle, when invoked, will perform the following
+ * steps:
+ * <ul>
+ * <li>Convert the incoming argument list to match the original
+ * method handle's argument list.
+ * <li>Invoke the original method handle on the converted argument list.
+ * <li>Convert any result returned by the original method handle
+ * to the return type of new method handle.
+ * </ul>
+ * <p>
+ * This method provides the crucial behavioral difference between
+ * {@link #invokeExact invokeExact} and plain, inexact {@link #invoke invoke}.
+ * The two methods
+ * perform the same steps when the caller's type descriptor exactly m atches
+ * the callee's, but when the types differ, plain {@link #invoke invoke}
+ * also calls {@code asType} (or some internal equivalent) in order
+ * to match up the caller's and callee's types.
+ * <p>
+ * If the current method is a variable arity method handle
+ * argument list conversion may involve the conversion and collection
+ * of several arguments into an array, as
+ * {@linkplain #asVarargsCollector described elsewhere}.
+ * In every other case, all conversions are applied <em>pairwise</em>,
+ * which means that each argument or return value is converted to
+ * exactly one argument or return value (or no return value).
+ * The applied conversions are defined by consulting the
+ * the corresponding component types of the old and new
+ * method handle types.
+ * <p>
+ * Let <em>T0</em> and <em>T1</em> be corresponding new and old parameter types,
+ * or old and new return types. Specifically, for some valid index {@code i}, let
+ * <em>T0</em>{@code =newType.parameterType(i)} and <em>T1</em>{@code =this.type().parameterType(i)}.
+ * Or else, going the other way for return values, let
+ * <em>T0</em>{@code =this.type().returnType()} and <em>T1</em>{@code =newType.returnType()}.
+ * If the types are the same, the new method handle makes no change
+ * to the corresponding argument or return value (if any).
+ * Otherwise, one of the following conversions is applied
+ * if possible:
+ * <ul>
+ * <li>If <em>T0</em> and <em>T1</em> are references, then a cast to <em>T1</em> is applied.
+ * (The types do not need to be related in any particular way.
+ * This is because a dynamic value of null can convert to any reference type.)
+ * <li>If <em>T0</em> and <em>T1</em> are primitives, then a Java method invocation
+ * conversion (JLS 5.3) is applied, if one exists.
+ * (Specifically, <em>T0</em> must convert to <em>T1</em> by a widening primitive conversion.)
+ * <li>If <em>T0</em> is a primitive and <em>T1</em> a reference,
+ * a Java casting conversion (JLS 5.5) is applied if one exists.
+ * (Specifically, the value is boxed from <em>T0</em> to its wrapper class,
+ * which is then widened as needed to <em>T1</em>.)
+ * <li>If <em>T0</em> is a reference and <em>T1</em> a primitive, an unboxing
+ * conversion will be applied at runtime, possibly followed
+ * by a Java method invocation conversion (JLS 5.3)
+ * on the primitive value. (These are the primitive widening conversions.)
+ * <em>T0</em> must be a wrapper class or a supertype of one.
+ * (In the case where <em>T0</em> is Object, these are the conversions
+ * allowed by {@link java.lang.reflect.Method#invoke java.lang.reflect.Method.invoke}.)
+ * The unboxing conversion must have a possibility of success, which means that
+ * if <em>T0</em> is not itself a wrapper class, there must exist at least one
+ * wrapper class <em>TW</em> which is a subtype of <em>T0</em> and whose unboxed
+ * primitive value can be widened to <em>T1</em>.
+ * <li>If the return type <em>T1</em> is marked as void, any returned value is discarded
+ * <li>If the return type <em>T0</em> is void and <em>T1</em> a reference, a null value is introduced.
+ * <li>If the return type <em>T0</em> is void and <em>T1</em> a primitive,
+ * a zero value is introduced.
+ * </ul>
+ * (<em>Note:</em> Both <em>T0</em> and <em>T1</em> may be regarded as static types,
+ * because neither corresponds specifically to the <em>dynamic type</em> of any
+ * actual argument or return value.)
+ * <p>
+ * The method handle conversion cannot be made if any one of the required
+ * pairwise conversions cannot be made.
+ * <p>
+ * At runtime, the conversions applied to reference arguments
+ * or return values may require additional runtime checks which can fail.
+ * An unboxing operation may fail because the original reference is null,
+ * causing a {@link java.lang.NullPointerException NullPointerException}.
+ * An unboxing operation or a reference cast may also fail on a reference
+ * to an object of the wrong type,
+ * causing a {@link java.lang.ClassCastException ClassCastException}.
+ * Although an unboxing operation may accept several kinds of wrappers,
+ * if none are available, a {@code ClassCastException} will be thrown.
+ *
+ * @param newType the expected type of the new method handle
+ * @return a method handle which delegates to {@code this} after performing
+ * any necessary argument conversions, and arranges for any
+ * necessary return value conversions
+ * @throws NullPointerException if {@code newType} is a null reference
+ * @throws WrongMethodTypeException if the conversion cannot be made
+ */
+ // @see MethodHandles#explicitCastArguments
+ // Android-changed, TODO(narayan): Bring back @see once the MethodHandles class is ready for use.
+ public MethodHandle asType(MethodType newType) {
+ // Fast path alternative to a heavyweight {@code asType} call.
+ // Return 'this' if the conversion will be a no-op.
+ if (newType == type) {
+ return this;
+ }
+ // Return 'this.asTypeCache' if the conversion is already memoized.
+ MethodHandle atc = asTypeCached(newType);
+ if (atc != null) {
+ return atc;
+ }
+ return asTypeUncached(newType);
+ }
+
+ private MethodHandle asTypeCached(MethodType newType) {
+ MethodHandle atc = asTypeCache;
+ if (atc != null && newType == atc.type) {
+ return atc;
+ }
+ return null;
+ }
+
+ /** Override this to change asType behavior. */
+ /*non-public*/ MethodHandle asTypeUncached(MethodType newType) {
+ if (!type.isConvertibleTo(newType))
+ throw new WrongMethodTypeException("cannot convert "+this+" to "+newType);
+ // Android-changed, TODO(narayan): Not implemented yet.
+ throw new UnsupportedOperationException("asTypeUncached(MethodType)");
+ }
+
+ /**
+ * Makes an <em>array-spreading</em> method handle, which accepts a trailing array argument
+ * and spreads its elements as positional arguments.
+ * The new method handle adapts, as its <i>target</i>,
+ * the current method handle. The type of the adapter will be
+ * the same as the type of the target, except that the final
+ * {@code arrayLength} parameters of the target's type are replaced
+ * by a single array parameter of type {@code arrayType}.
+ * <p>
+ * If the array element type differs from any of the corresponding
+ * argument types on the original target,
+ * the original target is adapted to take the array elements directly,
+ * as if by a call to {@link #asType asType}.
+ * <p>
+ * When called, the adapter replaces a trailing array argument
+ * by the array's elements, each as its own argument to the target.
+ * (The order of the arguments is preserved.)
+ * They are converted pairwise by casting and/or unboxing
+ * to the types of the trailing parameters of the target.
+ * Finally the target is called.
+ * What the target eventually returns is returned unchanged by the adapter.
+ * <p>
+ * Before calling the target, the adapter verifies that the array
+ * contains exactly enough elements to provide a correct argument count
+ * to the target method handle.
+ * (The array may also be null when zero elements are required.)
+ * <p>
+ * If, when the adapter is called, the supplied array argument does
+ * not have the correct number of elements, the adapter will throw
+ * an {@link IllegalArgumentException} instead of invoking the target.
+ * <p>
+ * Here are some simple examples of array-spreading method handles:
+ * <blockquote><pre>{@code
+MethodHandle equals = publicLookup()
+ .findVirtual(String.class, "equals", methodType(boolean.class, Object.class));
+assert( (boolean) equals.invokeExact("me", (Object)"me"));
+assert(!(boolean) equals.invokeExact("me", (Object)"thee"));
+// spread both arguments from a 2-array:
+MethodHandle eq2 = equals.asSpreader(Object[].class, 2);
+assert( (boolean) eq2.invokeExact(new Object[]{ "me", "me" }));
+assert(!(boolean) eq2.invokeExact(new Object[]{ "me", "thee" }));
+// try to spread from anything but a 2-array:
+for (int n = 0; n <= 10; n++) {
+ Object[] badArityArgs = (n == 2 ? null : new Object[n]);
+ try { assert((boolean) eq2.invokeExact(badArityArgs) && false); }
+ catch (IllegalArgumentException ex) { } // OK
+}
+// spread both arguments from a String array:
+MethodHandle eq2s = equals.asSpreader(String[].class, 2);
+assert( (boolean) eq2s.invokeExact(new String[]{ "me", "me" }));
+assert(!(boolean) eq2s.invokeExact(new String[]{ "me", "thee" }));
+// spread second arguments from a 1-array:
+MethodHandle eq1 = equals.asSpreader(Object[].class, 1);
+assert( (boolean) eq1.invokeExact("me", new Object[]{ "me" }));
+assert(!(boolean) eq1.invokeExact("me", new Object[]{ "thee" }));
+// spread no arguments from a 0-array or null:
+MethodHandle eq0 = equals.asSpreader(Object[].class, 0);
+assert( (boolean) eq0.invokeExact("me", (Object)"me", new Object[0]));
+assert(!(boolean) eq0.invokeExact("me", (Object)"thee", (Object[])null));
+// asSpreader and asCollector are approximate inverses:
+for (int n = 0; n <= 2; n++) {
+ for (Class<?> a : new Class<?>[]{Object[].class, String[].class, CharSequence[].class}) {
+ MethodHandle equals2 = equals.asSpreader(a, n).asCollector(a, n);
+ assert( (boolean) equals2.invokeWithArguments("me", "me"));
+ assert(!(boolean) equals2.invokeWithArguments("me", "thee"));
+ }
+}
+MethodHandle caToString = publicLookup()
+ .findStatic(Arrays.class, "toString", methodType(String.class, char[].class));
+assertEquals("[A, B, C]", (String) caToString.invokeExact("ABC".toCharArray()));
+MethodHandle caString3 = caToString.asCollector(char[].class, 3);
+assertEquals("[A, B, C]", (String) caString3.invokeExact('A', 'B', 'C'));
+MethodHandle caToString2 = caString3.asSpreader(char[].class, 2);
+assertEquals("[A, B, C]", (String) caToString2.invokeExact('A', "BC".toCharArray()));
+ * }</pre></blockquote>
+ * @param arrayType usually {@code Object[]}, the type of the array argument from which to extract the spread arguments
+ * @param arrayLength the number of arguments to spread from an incoming array argument
+ * @return a new method handle which spreads its final array argument,
+ * before calling the original method handle
+ * @throws NullPointerException if {@code arrayType} is a null reference
+ * @throws IllegalArgumentException if {@code arrayType} is not an array type,
+ * or if target does not have at least
+ * {@code arrayLength} parameter types,
+ * or if {@code arrayLength} is negative,
+ * or if the resulting method handle's type would have
+ * <a href="MethodHandle.html#maxarity">too many parameters</a>
+ * @throws WrongMethodTypeException if the implied {@code asType} call fails
+ * @see #asCollector
+ */
+ public MethodHandle asSpreader(Class<?> arrayType, int arrayLength) {
+ MethodType postSpreadType = asSpreaderChecks(arrayType, arrayLength);
+
+ // Android-changed, TODO(narayan): Not implemented yet.
+ throw new UnsupportedOperationException("asSpreader(Class<?>, int)");
+ }
+
+ /**
+ * See if {@code asSpreader} can be validly called with the given arguments.
+ * Return the type of the method handle call after spreading but before conversions.
+ */
+ private MethodType asSpreaderChecks(Class<?> arrayType, int arrayLength) {
+ spreadArrayChecks(arrayType, arrayLength);
+ int nargs = type().parameterCount();
+ if (nargs < arrayLength || arrayLength < 0)
+ throw newIllegalArgumentException("bad spread array length");
+ Class<?> arrayElement = arrayType.getComponentType();
+ MethodType mtype = type();
+ boolean match = true, fail = false;
+ for (int i = nargs - arrayLength; i < nargs; i++) {
+ Class<?> ptype = mtype.parameterType(i);
+ if (ptype != arrayElement) {
+ match = false;
+ if (!MethodType.canConvert(arrayElement, ptype)) {
+ fail = true;
+ break;
+ }
+ }
+ }
+ if (match) return mtype;
+ MethodType needType = mtype.asSpreaderType(arrayType, arrayLength);
+ if (!fail) return needType;
+ // elicit an error:
+ this.asType(needType);
+ throw newInternalError("should not return", null);
+ }
+
+ private void spreadArrayChecks(Class<?> arrayType, int arrayLength) {
+ Class<?> arrayElement = arrayType.getComponentType();
+ if (arrayElement == null)
+ throw newIllegalArgumentException("not an array type", arrayType);
+ if ((arrayLength & 0x7F) != arrayLength) {
+ if ((arrayLength & 0xFF) != arrayLength)
+ throw newIllegalArgumentException("array length is not legal", arrayLength);
+ assert(arrayLength >= 128);
+ if (arrayElement == long.class ||
+ arrayElement == double.class)
+ throw newIllegalArgumentException("array length is not legal for long[] or double[]", arrayLength);
+ }
+ }
+
+ /**
+ * Makes an <em>array-collecting</em> method handle, which accepts a given number of trailing
+ * positional arguments and collects them into an array argument.
+ * The new method handle adapts, as its <i>target</i>,
+ * the current method handle. The type of the adapter will be
+ * the same as the type of the target, except that a single trailing
+ * parameter (usually of type {@code arrayType}) is replaced by
+ * {@code arrayLength} parameters whose type is element type of {@code arrayType}.
+ * <p>
+ * If the array type differs from the final argument type on the original target,
+ * the original target is adapted to take the array type directly,
+ * as if by a call to {@link #asType asType}.
+ * <p>
+ * When called, the adapter replaces its trailing {@code arrayLength}
+ * arguments by a single new array of type {@code arrayType}, whose elements
+ * comprise (in order) the replaced arguments.
+ * Finally the target is called.
+ * What the target eventually returns is returned unchanged by the adapter.
+ * <p>
+ * (The array may also be a shared constant when {@code arrayLength} is zero.)
+ * <p>
+ * (<em>Note:</em> The {@code arrayType} is often identical to the last
+ * parameter type of the original target.
+ * It is an explicit argument for symmetry with {@code asSpreader}, and also
+ * to allow the target to use a simple {@code Object} as its last parameter type.)
+ * <p>
+ * In order to create a collecting adapter which is not restricted to a particular
+ * number of collected arguments, use {@link #asVarargsCollector asVarargsCollector} instead.
+ * <p>
+ * Here are some examples of array-collecting method handles:
+ * <blockquote><pre>{@code
+MethodHandle deepToString = publicLookup()
+ .findStatic(Arrays.class, "deepToString", methodType(String.class, Object[].class));
+assertEquals("[won]", (String) deepToString.invokeExact(new Object[]{"won"}));
+MethodHandle ts1 = deepToString.asCollector(Object[].class, 1);
+assertEquals(methodType(String.class, Object.class), ts1.type());
+//assertEquals("[won]", (String) ts1.invokeExact( new Object[]{"won"})); //FAIL
+assertEquals("[[won]]", (String) ts1.invokeExact((Object) new Object[]{"won"}));
+// arrayType can be a subtype of Object[]
+MethodHandle ts2 = deepToString.asCollector(String[].class, 2);
+assertEquals(methodType(String.class, String.class, String.class), ts2.type());
+assertEquals("[two, too]", (String) ts2.invokeExact("two", "too"));
+MethodHandle ts0 = deepToString.asCollector(Object[].class, 0);
+assertEquals("[]", (String) ts0.invokeExact());
+// collectors can be nested, Lisp-style
+MethodHandle ts22 = deepToString.asCollector(Object[].class, 3).asCollector(String[].class, 2);
+assertEquals("[A, B, [C, D]]", ((String) ts22.invokeExact((Object)'A', (Object)"B", "C", "D")));
+// arrayType can be any primitive array type
+MethodHandle bytesToString = publicLookup()
+ .findStatic(Arrays.class, "toString", methodType(String.class, byte[].class))
+ .asCollector(byte[].class, 3);
+assertEquals("[1, 2, 3]", (String) bytesToString.invokeExact((byte)1, (byte)2, (byte)3));
+MethodHandle longsToString = publicLookup()
+ .findStatic(Arrays.class, "toString", methodType(String.class, long[].class))
+ .asCollector(long[].class, 1);
+assertEquals("[123]", (String) longsToString.invokeExact((long)123));
+ * }</pre></blockquote>
+ * @param arrayType often {@code Object[]}, the type of the array argument which will collect the arguments
+ * @param arrayLength the number of arguments to collect into a new array argument
+ * @return a new method handle which collects some trailing argument
+ * into an array, before calling the original method handle
+ * @throws NullPointerException if {@code arrayType} is a null reference
+ * @throws IllegalArgumentException if {@code arrayType} is not an array type
+ * or {@code arrayType} is not assignable to this method handle's trailing parameter type,
+ * or {@code arrayLength} is not a legal array size,
+ * or the resulting method handle's type would have
+ * <a href="MethodHandle.html#maxarity">too many parameters</a>
+ * @throws WrongMethodTypeException if the implied {@code asType} call fails
+ * @see #asSpreader
+ * @see #asVarargsCollector
+ */
+ public MethodHandle asCollector(Class<?> arrayType, int arrayLength) {
+ asCollectorChecks(arrayType, arrayLength);
+
+ // Android-changed, TODO(narayan): Not implemented yet.
+ throw new UnsupportedOperationException("asCollector(Class<?>, int)");
+ }
+
+ /**
+ * See if {@code asCollector} can be validly called with the given arguments.
+ * Return false if the last parameter is not an exact match to arrayType.
+ */
+ /*non-public*/ boolean asCollectorChecks(Class<?> arrayType, int arrayLength) {
+ spreadArrayChecks(arrayType, arrayLength);
+ int nargs = type().parameterCount();
+ if (nargs != 0) {
+ Class<?> lastParam = type().parameterType(nargs-1);
+ if (lastParam == arrayType) return true;
+ if (lastParam.isAssignableFrom(arrayType)) return false;
+ }
+ throw newIllegalArgumentException("array type not assignable to trailing argument", this, arrayType);
+ }
+
+ /**
+ * Makes a <em>variable arity</em> adapter which is able to accept
+ * any number of trailing positional arguments and collect them
+ * into an array argument.
+ * <p>
+ * The type and behavior of the adapter will be the same as
+ * the type and behavior of the target, except that certain
+ * {@code invoke} and {@code asType} requests can lead to
+ * trailing positional arguments being collected into target's
+ * trailing parameter.
+ * Also, the last parameter type of the adapter will be
+ * {@code arrayType}, even if the target has a different
+ * last parameter type.
+ * <p>
+ * This transformation may return {@code this} if the method handle is
+ * already of variable arity and its trailing parameter type
+ * is identical to {@code arrayType}.
+ * <p>
+ * When called with {@link #invokeExact invokeExact}, the adapter invokes
+ * the target with no argument changes.
+ * (<em>Note:</em> This behavior is different from a
+ * {@linkplain #asCollector fixed arity collector},
+ * since it accepts a whole array of indeterminate length,
+ * rather than a fixed number of arguments.)
+ * <p>
+ * When called with plain, inexact {@link #invoke invoke}, if the caller
+ * type is the same as the adapter, the adapter invokes the target as with
+ * {@code invokeExact}.
+ * (This is the normal behavior for {@code invoke} when types match.)
+ * <p>
+ * Otherwise, if the caller and adapter arity are the same, and the
+ * trailing parameter type of the caller is a reference type identical to
+ * or assignable to the trailing parameter type of the adapter,
+ * the arguments and return values are converted pairwise,
+ * as if by {@link #asType asType} on a fixed arity
+ * method handle.
+ * <p>
+ * Otherwise, the arities differ, or the adapter's trailing parameter
+ * type is not assignable from the corresponding caller type.
+ * In this case, the adapter replaces all trailing arguments from
+ * the original trailing argument position onward, by
+ * a new array of type {@code arrayType}, whose elements
+ * comprise (in order) the replaced arguments.
+ * <p>
+ * The caller type must provides as least enough arguments,
+ * and of the correct type, to satisfy the target's requirement for
+ * positional arguments before the trailing array argument.
+ * Thus, the caller must supply, at a minimum, {@code N-1} arguments,
+ * where {@code N} is the arity of the target.
+ * Also, there must exist conversions from the incoming arguments
+ * to the target's arguments.
+ * As with other uses of plain {@code invoke}, if these basic
+ * requirements are not fulfilled, a {@code WrongMethodTypeException}
+ * may be thrown.
+ * <p>
+ * In all cases, what the target eventually returns is returned unchanged by the adapter.
+ * <p>
+ * In the final case, it is exactly as if the target method handle were
+ * temporarily adapted with a {@linkplain #asCollector fixed arity collector}
+ * to the arity required by the caller type.
+ * (As with {@code asCollector}, if the array length is zero,
+ * a shared constant may be used instead of a new array.
+ * If the implied call to {@code asCollector} would throw
+ * an {@code IllegalArgumentException} or {@code WrongMethodTypeException},
+ * the call to the variable arity adapter must throw
+ * {@code WrongMethodTypeException}.)
+ * <p>
+ * The behavior of {@link #asType asType} is also specialized for
+ * variable arity adapters, to maintain the invariant that
+ * plain, inexact {@code invoke} is always equivalent to an {@code asType}
+ * call to adjust the target type, followed by {@code invokeExact}.
+ * Therefore, a variable arity adapter responds
+ * to an {@code asType} request by building a fixed arity collector,
+ * if and only if the adapter and requested type differ either
+ * in arity or trailing argument type.
+ * The resulting fixed arity collector has its type further adjusted
+ * (if necessary) to the requested type by pairwise conversion,
+ * as if by another application of {@code asType}.
+ * <p>
+ * When a method handle is obtained by executing an {@code ldc} instruction
+ * of a {@code CONSTANT_MethodHandle} constant, and the target method is marked
+ * as a variable arity method (with the modifier bit {@code 0x0080}),
+ * the method handle will accept multiple arities, as if the method handle
+ * constant were created by means of a call to {@code asVarargsCollector}.
+ * <p>
+ * In order to create a collecting adapter which collects a predetermined
+ * number of arguments, and whose type reflects this predetermined number,
+ * use {@link #asCollector asCollector} instead.
+ * <p>
+ * No method handle transformations produce new method handles with
+ * variable arity, unless they are documented as doing so.
+ * Therefore, besides {@code asVarargsCollector},
+ * all methods in {@code MethodHandle} and {@code MethodHandles}
+ * will return a method handle with fixed arity,
+ * except in the cases where they are specified to return their original
+ * operand (e.g., {@code asType} of the method handle's own type).
+ * <p>
+ * Calling {@code asVarargsCollector} on a method handle which is already
+ * of variable arity will produce a method handle with the same type and behavior.
+ * It may (or may not) return the original variable arity method handle.
+ * <p>
+ * Here is an example, of a list-making variable arity method handle:
+ * <blockquote><pre>{@code
+MethodHandle deepToString = publicLookup()
+ .findStatic(Arrays.class, "deepToString", methodType(String.class, Object[].class));
+MethodHandle ts1 = deepToString.asVarargsCollector(Object[].class);
+assertEquals("[won]", (String) ts1.invokeExact( new Object[]{"won"}));
+assertEquals("[won]", (String) ts1.invoke( new Object[]{"won"}));
+assertEquals("[won]", (String) ts1.invoke( "won" ));
+assertEquals("[[won]]", (String) ts1.invoke((Object) new Object[]{"won"}));
+// findStatic of Arrays.asList(...) produces a variable arity method handle:
+MethodHandle asList = publicLookup()
+ .findStatic(Arrays.class, "asList", methodType(List.class, Object[].class));
+assertEquals(methodType(List.class, Object[].class), asList.type());
+assert(asList.isVarargsCollector());
+assertEquals("[]", asList.invoke().toString());
+assertEquals("[1]", asList.invoke(1).toString());
+assertEquals("[two, too]", asList.invoke("two", "too").toString());
+String[] argv = { "three", "thee", "tee" };
+assertEquals("[three, thee, tee]", asList.invoke(argv).toString());
+assertEquals("[three, thee, tee]", asList.invoke((Object[])argv).toString());
+List ls = (List) asList.invoke((Object)argv);
+assertEquals(1, ls.size());
+assertEquals("[three, thee, tee]", Arrays.toString((Object[])ls.get(0)));
+ * }</pre></blockquote>
+ * <p style="font-size:smaller;">
+ * <em>Discussion:</em>
+ * These rules are designed as a dynamically-typed variation
+ * of the Java rules for variable arity methods.
+ * In both cases, callers to a variable arity method or method handle
+ * can either pass zero or more positional arguments, or else pass
+ * pre-collected arrays of any length. Users should be aware of the
+ * special role of the final argument, and of the effect of a
+ * type match on that final argument, which determines whether
+ * or not a single trailing argument is interpreted as a whole
+ * array or a single element of an array to be collected.
+ * Note that the dynamic type of the trailing argument has no
+ * effect on this decision, only a comparison between the symbolic
+ * type descriptor of the call site and the type descriptor of the method handle.)
+ *
+ * @param arrayType often {@code Object[]}, the type of the array argument which will collect the arguments
+ * @return a new method handle which can collect any number of trailing arguments
+ * into an array, before calling the original method handle
+ * @throws NullPointerException if {@code arrayType} is a null reference
+ * @throws IllegalArgumentException if {@code arrayType} is not an array type
+ * or {@code arrayType} is not assignable to this method handle's trailing parameter type
+ * @see #asCollector
+ * @see #isVarargsCollector
+ * @see #asFixedArity
+ */
+ public MethodHandle asVarargsCollector(Class<?> arrayType) {
+ arrayType.getClass(); // explicit NPE
+ boolean lastMatch = asCollectorChecks(arrayType, 0);
+ if (isVarargsCollector() && lastMatch)
+ return this;
+
+ // Android-changed, TODO(narayan): Not implemented yet.
+ throw new UnsupportedOperationException("asVarargsCollector(Class<?>)");
+ }
+
+ /**
+ * Determines if this method handle
+ * supports {@linkplain #asVarargsCollector variable arity} calls.
+ * Such method handles arise from the following sources:
+ * <ul>
+ * <li>a call to {@linkplain #asVarargsCollector asVarargsCollector}
+ * <li>a call to a {@code java.lang.invoke.MethodHandles.Lookup lookup method}
+ * which resolves to a variable arity Java method or constructor
+ * <li>an {@code ldc} instruction of a {@code CONSTANT_MethodHandle}
+ * which resolves to a variable arity Java method or constructor
+ * </ul>
+ * @return true if this method handle accepts more than one arity of plain, inexact {@code invoke} calls
+ * @see #asVarargsCollector
+ * @see #asFixedArity
+ */
+ // Android-changed, TODO(narayan): Replace @code with @linkplain once MethodHandles
+ // is ready for use.
+ public boolean isVarargsCollector() {
+ return false;
+ }
+
+ /**
+ * Makes a <em>fixed arity</em> method handle which is otherwise
+ * equivalent to the current method handle.
+ * <p>
+ * If the current method handle is not of
+ * {@linkplain #asVarargsCollector variable arity},
+ * the current method handle is returned.
+ * This is true even if the current method handle
+ * could not be a valid input to {@code asVarargsCollector}.
+ * <p>
+ * Otherwise, the resulting fixed-arity method handle has the same
+ * type and behavior of the current method handle,
+ * except that {@link #isVarargsCollector isVarargsCollector}
+ * will be false.
+ * The fixed-arity method handle may (or may not) be the
+ * a previous argument to {@code asVarargsCollector}.
+ * <p>
+ * Here is an example, of a list-making variable arity method handle:
+ * <blockquote><pre>{@code
+MethodHandle asListVar = publicLookup()
+ .findStatic(Arrays.class, "asList", methodType(List.class, Object[].class))
+ .asVarargsCollector(Object[].class);
+MethodHandle asListFix = asListVar.asFixedArity();
+assertEquals("[1]", asListVar.invoke(1).toString());
+Exception caught = null;
+try { asListFix.invoke((Object)1); }
+catch (Exception ex) { caught = ex; }
+assert(caught instanceof ClassCastException);
+assertEquals("[two, too]", asListVar.invoke("two", "too").toString());
+try { asListFix.invoke("two", "too"); }
+catch (Exception ex) { caught = ex; }
+assert(caught instanceof WrongMethodTypeException);
+Object[] argv = { "three", "thee", "tee" };
+assertEquals("[three, thee, tee]", asListVar.invoke(argv).toString());
+assertEquals("[three, thee, tee]", asListFix.invoke(argv).toString());
+assertEquals(1, ((List) asListVar.invoke((Object)argv)).size());
+assertEquals("[three, thee, tee]", asListFix.invoke((Object)argv).toString());
+ * }</pre></blockquote>
+ *
+ * @return a new method handle which accepts only a fixed number of arguments
+ * @see #asVarargsCollector
+ * @see #isVarargsCollector
+ */
+ public MethodHandle asFixedArity() {
+ assert(!isVarargsCollector());
+ return this;
+ }
+
+ /**
+ * Binds a value {@code x} to the first argument of a method handle, without invoking it.
+ * The new method handle adapts, as its <i>target</i>,
+ * the current method handle by binding it to the given argument.
+ * The type of the bound handle will be
+ * the same as the type of the target, except that a single leading
+ * reference parameter will be omitted.
+ * <p>
+ * When called, the bound handle inserts the given value {@code x}
+ * as a new leading argument to the target. The other arguments are
+ * also passed unchanged.
+ * What the target eventually returns is returned unchanged by the bound handle.
+ * <p>
+ * The reference {@code x} must be convertible to the first parameter
+ * type of the target.
+ * <p>
+ * (<em>Note:</em> Because method handles are immutable, the target method handle
+ * retains its original type and behavior.)
+ * @param x the value to bind to the first argument of the target
+ * @return a new method handle which prepends the given value to the incoming
+ * argument list, before calling the original method handle
+ * @throws IllegalArgumentException if the target does not have a
+ * leading parameter type that is a reference type
+ * @throws ClassCastException if {@code x} cannot be converted
+ * to the leading parameter type of the target
+ */
+ // @see MethodHandles#insertArguments
+ // Android-changed, TODO(narayan): Bring back @see once the MethodHandles class is ready for use.
+ public MethodHandle bindTo(Object x) {
+ x = type.leadingReferenceParameter().cast(x); // throw CCE if needed
+
+ // Android-changed, TODO(narayan): Not implemented yet.
+ throw new UnsupportedOperationException("bindTo(Object)");
+ }
+
+ /**
+ * Returns a string representation of the method handle,
+ * starting with the string {@code "MethodHandle"} and
+ * ending with the string representation of the method handle's type.
+ * In other words, this method returns a string equal to the value of:
+ * <blockquote><pre>{@code
+ * "MethodHandle" + type().toString()
+ * }</pre></blockquote>
+ * <p>
+ * (<em>Note:</em> Future releases of this API may add further information
+ * to the string representation.
+ * Therefore, the present syntax should not be parsed by applications.)
+ *
+ * @return a string representation of the method handle
+ */
+ @Override
+ public String toString() {
+ // Android-changed: Removed debugging support.
+ return "MethodHandle"+type;
+ }
+
+ // Android-changed: Removed implementation details :
+ //
+ // String standardString();
+ // String debugString();
+ //
+ //// Implementation methods.
+ //// Sub-classes can override these default implementations.
+ //// All these methods assume arguments are already validated.
+ //
+ // Other transforms to do: convert, explicitCast, permute, drop, filter, fold, GWT, catch
+ //
+ // BoundMethodHandle bindArgumentL(int pos, Object value);
+ // /*non-public*/ MethodHandle setVarargs(MemberName member);
+ // /*non-public*/ MethodHandle viewAsType(MethodType newType, boolean strict);
+ // /*non-public*/ boolean viewAsTypeChecks(MethodType newType, boolean strict);
+ //
+ // Decoding
+ //
+ // /*non-public*/ LambdaForm internalForm();
+ // /*non-public*/ MemberName internalMemberName();
+ // /*non-public*/ Class<?> internalCallerClass();
+ // /*non-public*/ MethodHandleImpl.Intrinsic intrinsicName();
+ // /*non-public*/ MethodHandle withInternalMemberName(MemberName member, boolean isInvokeSpecial);
+ // /*non-public*/ boolean isInvokeSpecial();
+ // /*non-public*/ Object internalValues();
+ // /*non-public*/ Object internalProperties();
+ //
+ //// Method handle implementation methods.
+ //// Sub-classes can override these default implementations.
+ //// All these methods assume arguments are already validated.
+ //
+ // /*non-public*/ abstract MethodHandle copyWith(MethodType mt, LambdaForm lf);
+ // abstract BoundMethodHandle rebind();
+ // /*non-public*/ void updateForm(LambdaForm newForm);
+ // /*non-public*/ void customize();
+ // private static final long FORM_OFFSET;
+}
diff --git a/ojluni/src/main/java/java/lang/invoke/MethodType.java b/ojluni/src/main/java/java/lang/invoke/MethodType.java
index 3cafe89..38c781f 100644
--- a/ojluni/src/main/java/java/lang/invoke/MethodType.java
+++ b/ojluni/src/main/java/java/lang/invoke/MethodType.java
@@ -44,8 +44,8 @@
* and expected by a method handle caller. Method types must be properly
* matched between a method handle and all its callers,
* and the JVM's operations enforce this matching at, specifically
- * during calls to {@code MethodHandle#invokeExact MethodHandle.invokeExact}
- * and {@code MethodHandle#invoke MethodHandle.invoke}, and during execution
+ * during calls to {@link MethodHandle#invokeExact MethodHandle.invokeExact}
+ * and {@link MethodHandle#invoke MethodHandle.invoke}, and during execution
* of {@code invokedynamic} instructions.
* <p>
* The structure is a return type accompanied by any number of parameter types.
@@ -86,7 +86,6 @@
* This loading may occur at any time before the {@code MethodType} object is first derived.
* @author John Rose, JSR 292 EG
*/
-// Android-changed, TODO(narayan): Temporarily changed links to MethodHandle API to @code.
public final
class MethodType implements java.io.Serializable {
private static final long serialVersionUID = 292L; // {rtype, {ptype...}}
@@ -622,10 +621,9 @@
/**
* Erases all reference types to {@code Object}, and all subword types to {@code int}.
* This is the reduced type polymorphism used by private methods
- * such as {@code MethodHandle#invokeBasic invokeBasic}.
+ * such as {@link MethodHandle#invokeBasic invokeBasic}.
* @return a version of the original type with all reference and subword types replaced
*/
- // Android-changed, TODO(narayan): Temporarily changed links to MethodHandle API to @code.
/*non-public*/ MethodType basicType() {
return form.basicType();
}
@@ -634,10 +632,7 @@
* @return a version of the original type with MethodHandle prepended as the first argument
*/
/*non-public*/ MethodType invokerType() {
- // Android-changed, TODO(narayan): Temporarily disabled until MethodHandle.class is
- // available.
- // return insertParameterTypes(0, MethodHandle.class);
- throw new UnsupportedOperationException();
+ return insertParameterTypes(0, MethodHandle.class);
}
/**
diff --git a/ojluni/src/main/java/java/net/Inet6Address.java b/ojluni/src/main/java/java/net/Inet6Address.java
index 1fa8e04..013c4ca 100644
--- a/ojluni/src/main/java/java/net/Inet6Address.java
+++ b/ojluni/src/main/java/java/net/Inet6Address.java
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2014 The Android Open Source Project
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,10 +26,13 @@
package java.net;
-import java.io.ObjectInputStream;
import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.ObjectStreamField;
import java.util.Enumeration;
+import java.util.Arrays;
import libcore.io.Libcore;
import static android.system.OsConstants.*;
@@ -183,73 +186,226 @@
public static final InetAddress LOOPBACK = new Inet6Address("ip6-localhost",
new byte[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, 0);
- /**
- * Holds a 128-bit (16 bytes) IPv6 address.
- *
- * @serial
- */
- byte[] ipaddress;
+ private class Inet6AddressHolder {
- /**
- * scope_id. The scope specified when the object is created. If the object is created
- * with an interface name, then the scope_id is not determined until the time it is needed.
- */
- private int scope_id = 0;
+ private Inet6AddressHolder() {
+ ipaddress = new byte[INADDRSZ];
+ }
- /**
- * This will be set to true when the scope_id field contains a valid
- * integer scope_id.
- */
- private boolean scope_id_set = false;
+ private Inet6AddressHolder(
+ byte[] ipaddress, int scope_id, boolean scope_id_set,
+ NetworkInterface ifname, boolean scope_ifname_set)
+ {
+ this.ipaddress = ipaddress;
+ this.scope_id = scope_id;
+ this.scope_id_set = scope_id_set;
+ this.scope_ifname_set = scope_ifname_set;
+ this.scope_ifname = ifname;
+ }
- /**
- * scoped interface. scope_id is derived from this as the scope_id of the first
- * address whose scope is the same as this address for the named interface.
- */
- private transient NetworkInterface scope_ifname = null;
+ /**
+ * Holds a 128-bit (16 bytes) IPv6 address.
+ */
+ byte[] ipaddress;
- /**
- * set if the object is constructed with a scoped interface instead of a
- * numeric scope id.
- */
- private boolean scope_ifname_set = false;
+ /**
+ * scope_id. The scope specified when the object is created. If the object
+ * is created with an interface name, then the scope_id is not determined
+ * until the time it is needed.
+ */
+ int scope_id; // 0
+
+ /**
+ * This will be set to true when the scope_id field contains a valid
+ * integer scope_id.
+ */
+ boolean scope_id_set; // false
+
+ /**
+ * scoped interface. scope_id is derived from this as the scope_id of the first
+ * address whose scope is the same as this address for the named interface.
+ */
+ NetworkInterface scope_ifname; // null
+
+ /**
+ * set if the object is constructed with a scoped
+ * interface instead of a numeric scope id.
+ */
+ boolean scope_ifname_set; // false;
+
+ void setAddr(byte addr[]) {
+ if (addr.length == INADDRSZ) { // normal IPv6 address
+ System.arraycopy(addr, 0, ipaddress, 0, INADDRSZ);
+ }
+ }
+
+ void init(byte addr[], int scope_id) {
+ setAddr(addr);
+
+ // Android-changed: was >= 0
+ if (scope_id > 0) {
+ this.scope_id = scope_id;
+ this.scope_id_set = true;
+ }
+ }
+
+ void init(byte addr[], NetworkInterface nif)
+ throws UnknownHostException
+ {
+ setAddr(addr);
+
+ if (nif != null) {
+ this.scope_id = deriveNumericScope(ipaddress, nif);
+ this.scope_id_set = true;
+ this.scope_ifname = nif;
+ this.scope_ifname_set = true;
+ }
+ }
+
+ /* ----- android-removed -----
+ String getHostAddress() {
+ String s = numericToTextFormat(ipaddress);
+ if (scope_ifname != null) { // must check this first
+ s = s + "%" + scope_ifname.getName();
+ } else if (scope_id_set) {
+ s = s + "%" + scope_id;
+ }
+ return s;
+ } */
+
+ public boolean equals(Object o) {
+ if (! (o instanceof Inet6AddressHolder)) {
+ return false;
+ }
+ Inet6AddressHolder that = (Inet6AddressHolder)o;
+
+ return Arrays.equals(this.ipaddress, that.ipaddress);
+ }
+
+ public int hashCode() {
+ if (ipaddress != null) {
+
+ int hash = 0;
+ int i=0;
+ while (i<INADDRSZ) {
+ int j=0;
+ int component=0;
+ while (j<4 && i<INADDRSZ) {
+ component = (component << 8) + ipaddress[i];
+ j++;
+ i++;
+ }
+ hash += component;
+ }
+ return hash;
+
+ } else {
+ return 0;
+ }
+ }
+
+ boolean isIPv4CompatibleAddress() {
+ if ((ipaddress[0] == 0x00) && (ipaddress[1] == 0x00) &&
+ (ipaddress[2] == 0x00) && (ipaddress[3] == 0x00) &&
+ (ipaddress[4] == 0x00) && (ipaddress[5] == 0x00) &&
+ (ipaddress[6] == 0x00) && (ipaddress[7] == 0x00) &&
+ (ipaddress[8] == 0x00) && (ipaddress[9] == 0x00) &&
+ (ipaddress[10] == 0x00) && (ipaddress[11] == 0x00)) {
+ return true;
+ }
+ return false;
+ }
+
+ boolean isMulticastAddress() {
+ return ((ipaddress[0] & 0xff) == 0xff);
+ }
+
+ boolean isAnyLocalAddress() {
+ byte test = 0x00;
+ for (int i = 0; i < INADDRSZ; i++) {
+ test |= ipaddress[i];
+ }
+ return (test == 0x00);
+ }
+
+ boolean isLoopbackAddress() {
+ byte test = 0x00;
+ for (int i = 0; i < 15; i++) {
+ test |= ipaddress[i];
+ }
+ return (test == 0x00) && (ipaddress[15] == 0x01);
+ }
+
+ boolean isLinkLocalAddress() {
+ return ((ipaddress[0] & 0xff) == 0xfe
+ && (ipaddress[1] & 0xc0) == 0x80);
+ }
+
+
+ boolean isSiteLocalAddress() {
+ return ((ipaddress[0] & 0xff) == 0xfe
+ && (ipaddress[1] & 0xc0) == 0xc0);
+ }
+
+ boolean isMCGlobal() {
+ return ((ipaddress[0] & 0xff) == 0xff
+ && (ipaddress[1] & 0x0f) == 0x0e);
+ }
+
+ boolean isMCNodeLocal() {
+ return ((ipaddress[0] & 0xff) == 0xff
+ && (ipaddress[1] & 0x0f) == 0x01);
+ }
+
+ boolean isMCLinkLocal() {
+ return ((ipaddress[0] & 0xff) == 0xff
+ && (ipaddress[1] & 0x0f) == 0x02);
+ }
+
+ boolean isMCSiteLocal() {
+ return ((ipaddress[0] & 0xff) == 0xff
+ && (ipaddress[1] & 0x0f) == 0x05);
+ }
+
+ boolean isMCOrgLocal() {
+ return ((ipaddress[0] & 0xff) == 0xff
+ && (ipaddress[1] & 0x0f) == 0x08);
+ }
+ }
+
+ private final transient Inet6AddressHolder holder6;
private static final long serialVersionUID = 6880410070516793377L;
Inet6Address() {
super();
- holder().hostName = null;
- ipaddress = new byte[INADDRSZ];
- holder().family = AF_INET6;
+ holder.init(null, AF_INET6);
+ holder6 = new Inet6AddressHolder();
}
/* checking of value for scope_id should be done by caller
* scope_id must be >= 0, or -1 to indicate not being set
*/
Inet6Address(String hostName, byte addr[], int scope_id) {
- holder().hostName = hostName;
- if (addr.length == INADDRSZ) { // normal IPv6 address
- holder().family = AF_INET6;
- ipaddress = addr.clone();
- }
- // Android change, was >= 0.
- if (scope_id > 0) {
- this.scope_id = scope_id;
- scope_id_set = true;
- }
+ holder.init(hostName, AF_INET6);
+ holder6 = new Inet6AddressHolder();
+ holder6.init(addr, scope_id);
}
Inet6Address(String hostName, byte addr[]) {
+ holder6 = new Inet6AddressHolder();
try {
initif (hostName, addr, null);
} catch (UnknownHostException e) {} /* cant happen if ifname is null */
}
Inet6Address (String hostName, byte addr[], NetworkInterface nif) throws UnknownHostException {
+ holder6 = new Inet6AddressHolder();
initif (hostName, addr, nif);
}
Inet6Address (String hostName, byte addr[], String ifname) throws UnknownHostException {
+ holder6 = new Inet6AddressHolder();
initstr (hostName, addr, ifname);
}
@@ -339,16 +495,13 @@
private void initif(String hostName, byte addr[],NetworkInterface nif) throws UnknownHostException {
holder().hostName = hostName;
+ int family = -1;
+ holder6.init(addr, nif);
+
if (addr.length == INADDRSZ) { // normal IPv6 address
- holder().family = AF_INET6;
- ipaddress = addr.clone();
+ family = AF_INET6;
}
- if (nif != null) {
- this.scope_ifname = nif;
- scope_ifname_set = true;
- scope_id = deriveNumericScope (nif);
- scope_id_set = true;
- }
+ holder.init(hostName, family);
}
/* check the two Ipv6 addresses and return false if they are both
@@ -356,18 +509,22 @@
* (ie. one is sitelocal and the other linklocal)
* return true otherwise.
*/
- private boolean differentLocalAddressTypes(Inet6Address other) {
- if (isLinkLocalAddress() && !other.isLinkLocalAddress()) {
+ private static boolean isDifferentLocalAddressType(
+ byte[] thisAddr, byte[] otherAddr) {
+
+ if (Inet6Address.isLinkLocalAddress(thisAddr) &&
+ !Inet6Address.isLinkLocalAddress(otherAddr)) {
return false;
}
- if (isSiteLocalAddress() && !other.isSiteLocalAddress()) {
+ if (Inet6Address.isSiteLocalAddress(thisAddr) &&
+ !Inet6Address.isSiteLocalAddress(otherAddr)) {
return false;
}
return true;
}
- private int deriveNumericScope (NetworkInterface ifc) throws UnknownHostException {
+ private static int deriveNumericScope (byte[] thisAddr, NetworkInterface ifc) throws UnknownHostException {
Enumeration<InetAddress> addresses = ifc.getInetAddresses();
while (addresses.hasMoreElements()) {
InetAddress addr = addresses.nextElement();
@@ -376,12 +533,12 @@
}
Inet6Address ia6_addr = (Inet6Address)addr;
/* check if site or link local prefixes match */
- if (!differentLocalAddressTypes(ia6_addr)){
+ if (!isDifferentLocalAddressType(thisAddr, ia6_addr.getAddress())){
/* type not the same, so carry on searching */
continue;
}
/* found a matching address - return its scope_id */
- return ia6_addr.scope_id;
+ return ia6_addr.getScopeId();
}
throw new UnknownHostException ("no scope_id found");
}
@@ -396,41 +553,62 @@
while (en.hasMoreElements()) {
NetworkInterface ifc = en.nextElement();
if (ifc.getName().equals (ifname)) {
- Enumeration addresses = ifc.getInetAddresses();
- while (addresses.hasMoreElements()) {
- InetAddress addr = (InetAddress)addresses.nextElement();
- if (!(addr instanceof Inet6Address)) {
- continue;
- }
- Inet6Address ia6_addr = (Inet6Address)addr;
- /* check if site or link local prefixes match */
- if (!differentLocalAddressTypes(ia6_addr)){
- /* type not the same, so carry on searching */
- continue;
- }
- /* found a matching address - return its scope_id */
- return ia6_addr.scope_id;
- }
+ return deriveNumericScope(holder6.ipaddress, ifc);
}
}
throw new UnknownHostException ("No matching address found for interface : " +ifname);
}
/**
+ * @serialField ipaddress byte[]
+ * @serialField scope_id int
+ * @serialField scope_id_set boolean
+ * @serialField scope_ifname_set boolean
+ * @serialField ifname String
+ */
+
+ private static final ObjectStreamField[] serialPersistentFields = {
+ new ObjectStreamField("ipaddress", byte[].class),
+ new ObjectStreamField("scope_id", int.class),
+ new ObjectStreamField("scope_id_set", boolean.class),
+ new ObjectStreamField("scope_ifname_set", boolean.class),
+ new ObjectStreamField("ifname", String.class)
+ };
+
+ private static final long FIELDS_OFFSET;
+ private static final sun.misc.Unsafe UNSAFE;
+
+ static {
+ try {
+ sun.misc.Unsafe unsafe = sun.misc.Unsafe.getUnsafe();
+ FIELDS_OFFSET = unsafe.objectFieldOffset(
+ Inet6Address.class.getDeclaredField("holder6"));
+ UNSAFE = unsafe;
+ } catch (ReflectiveOperationException e) {
+ throw new Error(e);
+ }
+ }
+
+ /**
* restore the state of this object from stream
* including the scope information, only if the
* scoped interface name is valid on this system
*/
private void readObject(ObjectInputStream s)
throws IOException, ClassNotFoundException {
- scope_ifname = null;
- scope_ifname_set = false;
+ NetworkInterface scope_ifname = null;
+ // Android-changed: was getClass().getClassLoader() != null
if (getClass().getClassLoader() != Class.class.getClassLoader()) {
throw new SecurityException ("invalid address type");
}
- s.defaultReadObject();
+ ObjectInputStream.GetField gf = s.readFields();
+ byte[] ipaddress = (byte[])gf.get("ipaddress", null);
+ int scope_id = (int)gf.get("scope_id", -1);
+ boolean scope_id_set = (boolean)gf.get("scope_id_set", false);
+ boolean scope_ifname_set = (boolean)gf.get("scope_ifname_set", false);
+ String ifname = (String)gf.get("ifname", null);
if (ifname != null && !"".equals (ifname)) {
try {
@@ -442,8 +620,9 @@
scope_ifname_set = false;
scope_id = 0;
} else {
+ scope_ifname_set = true;
try {
- scope_id = deriveNumericScope (scope_ifname);
+ scope_id = deriveNumericScope (ipaddress, scope_ifname);
} catch (UnknownHostException e) {
// typically should not happen, but it may be that
// the machine being used for deserialization has
@@ -451,8 +630,8 @@
}
}
} catch (SocketException e) {}
-
}
+
/* if ifname was not supplied, then the numeric info is used */
ipaddress = ipaddress.clone();
@@ -466,6 +645,35 @@
if (holder().getFamily() != AF_INET6) {
throw new InvalidObjectException("invalid address family type");
}
+
+ Inet6AddressHolder h = new Inet6AddressHolder(
+ ipaddress, scope_id, scope_id_set, scope_ifname, scope_ifname_set
+ );
+
+ UNSAFE.putObject(this, FIELDS_OFFSET, h);
+ }
+
+ /**
+ * default behavior is overridden in order to write the
+ * scope_ifname field as a String, rather than a NetworkInterface
+ * which is not serializable
+ */
+ private synchronized void writeObject(ObjectOutputStream s)
+ throws IOException
+ {
+ String ifname = null;
+
+ if (holder6.scope_ifname != null) {
+ ifname = holder6.scope_ifname.getName();
+ holder6.scope_ifname_set = true;
+ }
+ ObjectOutputStream.PutField pfields = s.putFields();
+ pfields.put("ipaddress", holder6.ipaddress);
+ pfields.put("scope_id", holder6.scope_id);
+ pfields.put("scope_id_set", holder6.scope_id_set);
+ pfields.put("scope_ifname_set", holder6.scope_ifname_set);
+ pfields.put("ifname", ifname);
+ s.writeFields();
}
/**
@@ -480,7 +688,7 @@
*/
@Override
public boolean isMulticastAddress() {
- return ((ipaddress[0] & 0xff) == 0xff);
+ return holder6.isMulticastAddress();
}
/**
@@ -493,11 +701,7 @@
*/
@Override
public boolean isAnyLocalAddress() {
- byte test = 0x00;
- for (int i = 0; i < INADDRSZ; i++) {
- test |= ipaddress[i];
- }
- return (test == 0x00);
+ return holder6.isAnyLocalAddress();
}
/**
@@ -510,11 +714,7 @@
*/
@Override
public boolean isLoopbackAddress() {
- byte test = 0x00;
- for (int i = 0; i < 15; i++) {
- test |= ipaddress[i];
- }
- return (test == 0x00) && (ipaddress[15] == 0x01);
+ return holder6.isLoopbackAddress();
}
/**
@@ -522,10 +722,16 @@
*
* @return a {@code boolean} indicating if the InetAddress is a link local
* address; or false if address is not a link local unicast address.
+ *
* @since 1.4
*/
@Override
public boolean isLinkLocalAddress() {
+ return holder6.isLinkLocalAddress();
+ }
+
+ /* static version of above */
+ static boolean isLinkLocalAddress(byte[] ipaddress) {
return ((ipaddress[0] & 0xff) == 0xfe
&& (ipaddress[1] & 0xc0) == 0x80);
}
@@ -540,6 +746,11 @@
*/
@Override
public boolean isSiteLocalAddress() {
+ return holder6.isSiteLocalAddress();
+ }
+
+ /* static version of above */
+ static boolean isSiteLocalAddress(byte[] ipaddress) {
return ((ipaddress[0] & 0xff) == 0xfe
&& (ipaddress[1] & 0xc0) == 0xc0);
}
@@ -555,8 +766,7 @@
*/
@Override
public boolean isMCGlobal() {
- return ((ipaddress[0] & 0xff) == 0xff
- && (ipaddress[1] & 0x0f) == 0x0e);
+ return holder6.isMCGlobal();
}
/**
@@ -570,8 +780,7 @@
*/
@Override
public boolean isMCNodeLocal() {
- return ((ipaddress[0] & 0xff) == 0xff
- && (ipaddress[1] & 0x0f) == 0x01);
+ return holder6.isMCNodeLocal();
}
/**
@@ -585,8 +794,7 @@
*/
@Override
public boolean isMCLinkLocal() {
- return ((ipaddress[0] & 0xff) == 0xff
- && (ipaddress[1] & 0x0f) == 0x02);
+ return holder6.isMCLinkLocal();
}
/**
@@ -600,35 +808,32 @@
*/
@Override
public boolean isMCSiteLocal() {
- return ((ipaddress[0] & 0xff) == 0xff
- && (ipaddress[1] & 0x0f) == 0x05);
+ return holder6.isMCSiteLocal();
}
/**
* Utility routine to check if the multicast address has organization scope.
*
- * @return a {@code boolean} indicating if the address has
- * is a multicast address of organization-local scope,
- * false if it is not of organization-local scope
- * or it is not a multicast address
+ * @return a {@code boolean} indicating if the address has is a multicast
+ * address of organization-local scope, false if it is not of
+ * organization-local scope or it is not a multicast address
+ *
* @since 1.4
*/
@Override
public boolean isMCOrgLocal() {
- return ((ipaddress[0] & 0xff) == 0xff
- && (ipaddress[1] & 0x0f) == 0x08);
+ return holder6.isMCOrgLocal();
}
-
/**
- * Returns the raw IP address of this {@code InetAddress}
- * object. The result is in network byte order: the highest order
- * byte of the address is in {@code getAddress()[0]}.
+ * Returns the raw IP address of this {@code InetAddress} object. The result
+ * is in network byte order: the highest order byte of the address is in
+ * {@code getAddress()[0]}.
*
* @return the raw IP address of this object.
*/
@Override
public byte[] getAddress() {
- return ipaddress.clone();
+ return holder6.ipaddress.clone();
}
/**
@@ -636,10 +841,11 @@
* an interface. If no scoped_id is set, the returned value is zero.
*
* @return the scopeId, or zero if not set.
+ *
* @since 1.5
*/
- public int getScopeId () {
- return scope_id;
+ public int getScopeId() {
+ return holder6.scope_id;
}
/**
@@ -649,30 +855,25 @@
* @return the scoped interface, or null if not set.
* @since 1.5
*/
- public NetworkInterface getScopedInterface () {
- return scope_ifname;
+ public NetworkInterface getScopedInterface() {
+ return holder6.scope_ifname;
}
/**
- * Returns the IP address string in textual presentation. If the instance was created
- * specifying a scope identifier then the scope id is appended to the IP address preceded by
- * a "%" (per-cent) character. This can be either a numeric value or a string, depending on which
- * was used to createthe instance.
+ * Returns the IP address string in textual presentation. If the instance
+ * was created specifying a scope identifier then the scope id is appended
+ * to the IP address preceded by a "%" (per-cent) character. This can be
+ * either a numeric value or a string, depending on which was used to create
+ * the instance.
*
* @return the raw IP address in a string format.
*/
@Override
public String getHostAddress() {
-
/* ----- BEGIN android -----
- getnameinfo returns smarter representations
- String s = numericToTextFormat(ipaddress);
- if (scope_ifname_set) {
- s = s + "%" + scope_ifname.getName();
- } else if (scope_id_set) {
- s = s + "%" + scope_id;
- }
- return s;*/
+ * getnameinfo returns smarter representations
+ return holder6.getHostAddress();
+ */
return Libcore.os.getnameinfo(this, NI_NUMERICHOST); // Can't throw.
// ----- END android -----
@@ -685,81 +886,51 @@
*/
@Override
public int hashCode() {
- if (ipaddress != null) {
-
- int hash = 0;
- int i=0;
- while (i<INADDRSZ) {
- int j=0;
- int component=0;
- while (j<4 && i<INADDRSZ) {
- component = (component << 8) + ipaddress[i];
- j++;
- i++;
- }
- hash += component;
- }
- return hash;
-
- } else {
- return 0;
- }
+ return holder6.hashCode();
}
/**
- * Compares this object against the specified object.
- * The result is {@code true} if and only if the argument is
- * not {@code null} and it represents the same IP address as
- * this object.
- * <p>
- * Two instances of {@code InetAddress} represent the same IP
- * address if the length of the byte arrays returned by
- * {@code getAddress} is the same for both, and each of the
- * array components is the same for the byte arrays.
+ * Compares this object against the specified object. The result is {@code
+ * true} if and only if the argument is not {@code null} and it represents
+ * the same IP address as this object.
+ *
+ * <p> Two instances of {@code InetAddress} represent the same IP address
+ * if the length of the byte arrays returned by {@code getAddress} is the
+ * same for both, and each of the array components is the same for the byte
+ * arrays.
*
* @param obj the object to compare against.
- * @return {@code true} if the objects are the same;
- * {@code false} otherwise.
+ *
+ * @return {@code true} if the objects are the same; {@code false} otherwise.
+ *
* @see java.net.InetAddress#getAddress()
*/
@Override
public boolean equals(Object obj) {
- if (obj == null ||
- !(obj instanceof Inet6Address))
+ if (obj == null || !(obj instanceof Inet6Address))
return false;
Inet6Address inetAddr = (Inet6Address)obj;
- for (int i = 0; i < INADDRSZ; i++) {
- if (ipaddress[i] != inetAddr.ipaddress[i])
- return false;
- }
-
- return true;
+ return holder6.equals(inetAddr.holder6);
}
/**
* Utility routine to check if the InetAddress is an
* IPv4 compatible IPv6 address.
*
- * @return a {@code boolean} indicating if the InetAddress is
- * an IPv4 compatible IPv6 address; or false if address is IPv4 address.
+ * @return a {@code boolean} indicating if the InetAddress is an IPv4
+ * compatible IPv6 address; or false if address is IPv4 address.
+ *
* @since 1.4
*/
public boolean isIPv4CompatibleAddress() {
- if ((ipaddress[0] == 0x00) && (ipaddress[1] == 0x00) &&
- (ipaddress[2] == 0x00) && (ipaddress[3] == 0x00) &&
- (ipaddress[4] == 0x00) && (ipaddress[5] == 0x00) &&
- (ipaddress[6] == 0x00) && (ipaddress[7] == 0x00) &&
- (ipaddress[8] == 0x00) && (ipaddress[9] == 0x00) &&
- (ipaddress[10] == 0x00) && (ipaddress[11] == 0x00)) {
- return true;
- }
- return false;
+ return holder6.isIPv4CompatibleAddress();
}
// Utilities
private final static int INT16SZ = 2;
+
/*
* Convert IPv6 binary address into presentation (printable) format.
*
@@ -768,36 +939,15 @@
* textual representation format
* @since 1.4
*/
- static String numericToTextFormat(byte[] src)
- {
- StringBuffer sb = new StringBuffer(39);
+ static String numericToTextFormat(byte[] src) {
+ StringBuilder sb = new StringBuilder(39);
for (int i = 0; i < (INADDRSZ / INT16SZ); i++) {
sb.append(Integer.toHexString(((src[i<<1]<<8) & 0xff00)
| (src[(i<<1)+1] & 0xff)));
-
if (i < (INADDRSZ / INT16SZ) -1 ) {
sb.append(":");
}
}
return sb.toString();
}
-
- /**
- * Following field is only used during (de)/serialization
- */
- private String ifname;
-
- /**
- * default behavior is overridden in order to write the
- * scope_ifname field as a String, rather than a NetworkInterface
- * which is not serializable
- */
- private synchronized void writeObject(java.io.ObjectOutputStream s)
- throws IOException
- {
- if (scope_ifname_set) {
- ifname = scope_ifname.getName();
- }
- s.defaultWriteObject();
- }
}
diff --git a/ojluni/src/main/java/java/net/InetAddress.java b/ojluni/src/main/java/java/net/InetAddress.java
index edfdb00..b5dc761 100644
--- a/ojluni/src/main/java/java/net/InetAddress.java
+++ b/ojluni/src/main/java/java/net/InetAddress.java
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2014 The Android Open Source Project
- * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, 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
@@ -208,6 +208,14 @@
this.family = family;
}
+ void init(String hostName, int family) {
+ this.originalHostName = hostName;
+ this.hostName = hostName;
+ if (family != -1) {
+ this.family = family;
+ }
+ }
+
String hostName;
String getHostName() {
diff --git a/ojluni/src/main/java/java/nio/channels/spi/package.html b/ojluni/src/main/java/java/nio/channels/spi/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/charset/spi/package.html b/ojluni/src/main/java/java/nio/charset/spi/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/AccessControlException.java b/ojluni/src/main/java/java/security/AccessControlException.java
index baab01b..a4f2a78 100644
--- a/ojluni/src/main/java/java/security/AccessControlException.java
+++ b/ojluni/src/main/java/java/security/AccessControlException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -44,11 +44,11 @@
private static final long serialVersionUID = 5138225684096988535L;
- // the permission that caused the exeception to be thrown.
+ // the permission that caused the exception to be thrown.
private Permission perm;
/**
- * Constructs an <code>AccessControlException</code> with the
+ * Constructs an {@code AccessControlException} with the
* specified, detailed message.
*
* @param s the detail message.
@@ -58,7 +58,7 @@
}
/**
- * Constructs an <code>AccessControlException</code> with the
+ * Constructs an {@code AccessControlException} with the
* specified, detailed message, and the requested permission that caused
* the exception.
*
@@ -71,7 +71,7 @@
}
/**
- * Gets the Permission object associated with this exeception, or
+ * Gets the Permission object associated with this exception, or
* null if there was no corresponding Permission object.
*
* @return the Permission object.
diff --git a/ojluni/src/main/java/java/security/AlgorithmParameterGenerator.java b/ojluni/src/main/java/java/security/AlgorithmParameterGenerator.java
index 9e0bc55..5224158 100644
--- a/ojluni/src/main/java/java/security/AlgorithmParameterGenerator.java
+++ b/ojluni/src/main/java/java/security/AlgorithmParameterGenerator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,10 +28,10 @@
import java.security.spec.AlgorithmParameterSpec;
/**
- * The <code>AlgorithmParameterGenerator</code> class is used to generate a
+ * The {@code AlgorithmParameterGenerator} class is used to generate a
* set of
* parameters to be used with a certain algorithm. Parameter generators
- * are constructed using the <code>getInstance</code> factory methods
+ * are constructed using the {@code getInstance} factory methods
* (static methods that return instances of a given class).
*
* <P>The object that will generate the parameters can be initialized
@@ -48,7 +48,7 @@
* of the prime modulus (in bits).
* When using this approach, algorithm-specific parameter generation
* values - if any - default to some standard values, unless they can be
- * derived from the specified size.<P>
+ * derived from the specified size.
*
* <li>The other approach initializes a parameter generator object
* using algorithm-specific semantics, which are represented by a set of
@@ -61,7 +61,7 @@
*
* <P>In case the client does not explicitly initialize the
* AlgorithmParameterGenerator
- * (via a call to an <code>init</code> method), each provider must supply (and
+ * (via a call to an {@code init} method), each provider must supply (and
* document) a default initialization. For example, the Sun provider uses a
* default modulus prime size of 1024 bits for the generation of DSA
* parameters.
@@ -295,11 +295,11 @@
/**
* Initializes this parameter generator for a certain size.
- * To create the parameters, the <code>SecureRandom</code>
+ * To create the parameters, the {@code SecureRandom}
* implementation of the highest-priority installed provider is used as
* the source of randomness.
* (If none of the installed providers supply an implementation of
- * <code>SecureRandom</code>, a system-provided source of randomness is
+ * {@code SecureRandom}, a system-provided source of randomness is
* used.)
*
* @param size the size (number of bits).
@@ -322,11 +322,11 @@
/**
* Initializes this parameter generator with a set of algorithm-specific
* parameter generation values.
- * To generate the parameters, the <code>SecureRandom</code>
+ * To generate the parameters, the {@code SecureRandom}
* implementation of the highest-priority installed provider is used as
* the source of randomness.
* (If none of the installed providers supply an implementation of
- * <code>SecureRandom</code>, a system-provided source of randomness is
+ * {@code SecureRandom}, a system-provided source of randomness is
* used.)
*
* @param genParamSpec the set of algorithm-specific parameter generation values.
diff --git a/ojluni/src/main/java/java/security/AlgorithmParameterGeneratorSpi.java b/ojluni/src/main/java/java/security/AlgorithmParameterGeneratorSpi.java
index 729470a..721fb52 100644
--- a/ojluni/src/main/java/java/security/AlgorithmParameterGeneratorSpi.java
+++ b/ojluni/src/main/java/java/security/AlgorithmParameterGeneratorSpi.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
/**
* This class defines the <i>Service Provider Interface</i> (<b>SPI</b>)
- * for the <code>AlgorithmParameterGenerator</code> class, which
+ * for the {@code AlgorithmParameterGenerator} class, which
* is used to generate a set of parameters to be used with a certain algorithm.
*
* <p> All the abstract methods in this class must be implemented by each
@@ -37,7 +37,7 @@
* of a parameter generator for a particular algorithm.
*
* <p> In case the client does not explicitly initialize the
- * AlgorithmParameterGenerator (via a call to an <code>engineInit</code>
+ * AlgorithmParameterGenerator (via a call to an {@code engineInit}
* method), each provider must supply (and document) a default initialization.
* For example, the Sun provider uses a default modulus prime size of 1024
* bits for the generation of DSA parameters.
diff --git a/ojluni/src/main/java/java/security/AlgorithmParameters.java b/ojluni/src/main/java/java/security/AlgorithmParameters.java
index a090ece..af5ed7e 100644
--- a/ojluni/src/main/java/java/security/AlgorithmParameters.java
+++ b/ojluni/src/main/java/java/security/AlgorithmParameters.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,19 +32,19 @@
/**
* This class is used as an opaque representation of cryptographic parameters.
*
- * <p>An <code>AlgorithmParameters</code> object for managing the parameters
+ * <p>An {@code AlgorithmParameters} object for managing the parameters
* for a particular algorithm can be obtained by
- * calling one of the <code>getInstance</code> factory methods
+ * calling one of the {@code getInstance} factory methods
* (static methods that return instances of a given class).
*
- * <p>Once an <code>AlgorithmParameters</code> object is obtained, it must be
- * initialized via a call to <code>init</code>, using an appropriate parameter
+ * <p>Once an {@code AlgorithmParameters} object is obtained, it must be
+ * initialized via a call to {@code init}, using an appropriate parameter
* specification or parameter encoding.
*
* <p>A transparent parameter specification is obtained from an
- * <code>AlgorithmParameters</code> object via a call to
- * <code>getParameterSpec</code>, and a byte encoding of the parameters is
- * obtained via a call to <code>getEncoded</code>.
+ * {@code AlgorithmParameters} object via a call to
+ * {@code getParameterSpec}, and a byte encoding of the parameters is
+ * obtained via a call to {@code getEncoded}.
*
* <p> Android provides the following <code>AlgorithmParameters</code> algorithms:
* <table>
@@ -168,7 +168,7 @@
* the {@link Security#getProviders() Security.getProviders()} method.
*
* <p> The returned parameter object must be initialized via a call to
- * <code>init</code>, using an appropriate parameter specification or
+ * {@code init}, using an appropriate parameter specification or
* parameter encoding.
*
* @param algorithm the name of the algorithm requested.
@@ -210,7 +210,7 @@
* the {@link Security#getProviders() Security.getProviders()} method.
*
* <p>The returned parameter object must be initialized via a call to
- * <code>init</code>, using an appropriate parameter specification or
+ * {@code init}, using an appropriate parameter specification or
* parameter encoding.
*
* @param algorithm the name of the algorithm requested.
@@ -257,7 +257,7 @@
* does not have to be registered in the provider list.
*
* <p>The returned parameter object must be initialized via a call to
- * <code>init</code>, using an appropriate parameter specification or
+ * {@code init}, using an appropriate parameter specification or
* parameter encoding.
*
* @param algorithm the name of the algorithm requested.
@@ -304,7 +304,7 @@
/**
* Initializes this parameter object using the parameters
- * specified in <code>paramSpec</code>.
+ * specified in {@code paramSpec}.
*
* @param paramSpec the parameter specification.
*
@@ -340,9 +340,9 @@
}
/**
- * Imports the parameters from <code>params</code> and decodes them
+ * Imports the parameters from {@code params} and decodes them
* according to the specified decoding scheme.
- * If <code>format</code> is null, the
+ * If {@code format} is null, the
* primary decoding format for parameters is used. The primary decoding
* format is ASN.1, if an ASN.1 specification for these parameters
* exists.
@@ -363,12 +363,13 @@
/**
* Returns a (transparent) specification of this parameter object.
- * <code>paramSpec</code> identifies the specification class in which
+ * {@code paramSpec} identifies the specification class in which
* the parameters should be returned. It could, for example, be
- * <code>DSAParameterSpec.class</code>, to indicate that the
+ * {@code DSAParameterSpec.class}, to indicate that the
* parameters should be returned in an instance of the
- * <code>DSAParameterSpec</code> class.
+ * {@code DSAParameterSpec} class.
*
+ * @param <T> the type of the parameter specification to be returrned
* @param paramSpec the specification class in which
* the parameters should be returned.
*
@@ -408,7 +409,7 @@
/**
* Returns the parameters encoded in the specified scheme.
- * If <code>format</code> is null, the
+ * If {@code format} is null, the
* primary encoding format for parameters is used. The primary encoding
* format is ASN.1, if an ASN.1 specification for these parameters
* exists.
diff --git a/ojluni/src/main/java/java/security/AlgorithmParametersSpi.java b/ojluni/src/main/java/java/security/AlgorithmParametersSpi.java
index 17db77e..282493b 100644
--- a/ojluni/src/main/java/java/security/AlgorithmParametersSpi.java
+++ b/ojluni/src/main/java/java/security/AlgorithmParametersSpi.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,7 @@
/**
* This class defines the <i>Service Provider Interface</i> (<b>SPI</b>)
- * for the <code>AlgorithmParameters</code> class, which is used to manage
+ * for the {@code AlgorithmParameters} class, which is used to manage
* algorithm parameters.
*
* <p> All the abstract methods in this class must be implemented by each
@@ -52,7 +52,7 @@
/**
* Initializes this parameters object using the parameters
- * specified in <code>paramSpec</code>.
+ * specified in {@code paramSpec}.
*
* @param paramSpec the parameter specification.
*
@@ -77,9 +77,9 @@
throws IOException;
/**
- * Imports the parameters from <code>params</code> and
+ * Imports the parameters from {@code params} and
* decodes them according to the specified decoding format.
- * If <code>format</code> is null, the
+ * If {@code format} is null, the
* primary decoding format for parameters is used. The primary decoding
* format is ASN.1, if an ASN.1 specification for these parameters
* exists.
@@ -96,11 +96,13 @@
/**
* Returns a (transparent) specification of this parameters
* object.
- * <code>paramSpec</code> identifies the specification class in which
+ * {@code paramSpec} identifies the specification class in which
* the parameters should be returned. It could, for example, be
- * <code>DSAParameterSpec.class</code>, to indicate that the
+ * {@code DSAParameterSpec.class}, to indicate that the
* parameters should be returned in an instance of the
- * <code>DSAParameterSpec</code> class.
+ * {@code DSAParameterSpec} class.
+ *
+ * @param <T> the type of the parameter specification to be returned
*
* @param paramSpec the specification class in which
* the parameters should be returned.
@@ -128,7 +130,7 @@
/**
* Returns the parameters encoded in the specified format.
- * If <code>format</code> is null, the
+ * If {@code format} is null, the
* primary encoding format for parameters is used. The primary encoding
* format is ASN.1, if an ASN.1 specification for these parameters
* exists.
diff --git a/ojluni/src/main/java/java/security/Certificate.java b/ojluni/src/main/java/java/security/Certificate.java
index 000a5e0..489c6d6 100644
--- a/ojluni/src/main/java/java/security/Certificate.java
+++ b/ojluni/src/main/java/java/security/Certificate.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -96,7 +96,7 @@
/**
* Encodes the certificate to an output stream in a format that can
- * be decoded by the <code>decode</code> method.
+ * be decoded by the {@code decode} method.
*
* @param stream the output stream to which to encode the
* certificate.
@@ -115,8 +115,8 @@
/**
* Decodes a certificate from an input stream. The format should be
- * that returned by <code>getFormat</code> and produced by
- * <code>encode</code>.
+ * that returned by {@code getFormat} and produced by
+ * {@code encode}.
*
* @param stream the input stream from which to fetch the data
* being decoded.
@@ -137,8 +137,8 @@
/**
* Returns the name of the coding format. This is used as a hint to find
* an appropriate parser. It could be "X.509", "PGP", etc. This is
- * the format produced and understood by the <code>encode</code>
- * and <code>decode</code> methods.
+ * the format produced and understood by the {@code encode}
+ * and {@code decode} methods.
*
* @return the name of the coding format.
*/
diff --git a/ojluni/src/main/java/java/security/CodeSigner.java b/ojluni/src/main/java/java/security/CodeSigner.java
index 0b233d3..37c12b1 100644
--- a/ojluni/src/main/java/java/security/CodeSigner.java
+++ b/ojluni/src/main/java/java/security/CodeSigner.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -63,12 +63,12 @@
* Constructs a CodeSigner object.
*
* @param signerCertPath The signer's certificate path.
- * It must not be <code>null</code>.
+ * It must not be {@code null}.
* @param timestamp A signature timestamp.
- * If <code>null</code> then no timestamp was generated
+ * If {@code null} then no timestamp was generated
* for the signature.
- * @throws NullPointerException if <code>signerCertPath</code> is
- * <code>null</code>.
+ * @throws NullPointerException if {@code signerCertPath} is
+ * {@code null}.
*/
public CodeSigner(CertPath signerCertPath, Timestamp timestamp) {
if (signerCertPath == null) {
@@ -90,7 +90,7 @@
/**
* Returns the signature timestamp.
*
- * @return The timestamp or <code>null</code> if none is present.
+ * @return The timestamp or {@code null} if none is present.
*/
public Timestamp getTimestamp() {
return timestamp;
diff --git a/ojluni/src/main/java/java/security/DigestException.java b/ojluni/src/main/java/java/security/DigestException.java
index 9d44750..2327c98 100644
--- a/ojluni/src/main/java/java/security/DigestException.java
+++ b/ojluni/src/main/java/java/security/DigestException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -55,13 +55,13 @@
}
/**
- * Creates a <code>DigestException</code> with the specified
+ * Creates a {@code DigestException} with the specified
* detail message and cause.
*
* @param message the detail message (which is saved for later retrieval
* by the {@link #getMessage()} method).
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
@@ -70,13 +70,13 @@
}
/**
- * Creates a <code>DigestException</code> with the specified cause
- * and a detail message of <tt>(cause==null ? null : cause.toString())</tt>
+ * Creates a {@code DigestException} with the specified cause
+ * and a detail message of {@code (cause==null ? null : cause.toString())}
* (which typically contains the class and detail message of
- * <tt>cause</tt>).
+ * {@code cause}).
*
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
diff --git a/ojluni/src/main/java/java/security/DigestInputStream.java b/ojluni/src/main/java/java/security/DigestInputStream.java
index 8aa16dc..a1bf55a 100644
--- a/ojluni/src/main/java/java/security/DigestInputStream.java
+++ b/ojluni/src/main/java/java/security/DigestInputStream.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -37,13 +37,13 @@
* the bits going through the stream.
*
* <p>To complete the message digest computation, call one of the
- * <code>digest</code> methods on the associated message
+ * {@code digest} methods on the associated message
* digest after your calls to one of this digest input stream's
* {@link #read() read} methods.
*
* <p>It is possible to turn this stream on or off (see
* {@link #on(boolean) on}). When it is on, a call to one of the
- * <code>read</code> methods
+ * {@code read} methods
* results in an update on the message digest. But when it is off,
* the message digest is not updated. The default is for the stream
* to be on.
@@ -111,7 +111,7 @@
* function is on). That is, this method reads a byte from the
* input stream, blocking until the byte is actually read. If the
* digest function is on (see {@link #on(boolean) on}), this method
- * will then call <code>update</code> on the message digest associated
+ * will then call {@code update} on the message digest associated
* with this stream, passing it the byte read.
*
* @return the byte read.
@@ -131,25 +131,25 @@
/**
* Reads into a byte array, and updates the message digest (if the
* digest function is on). That is, this method reads up to
- * <code>len</code> bytes from the input stream into the array
- * <code>b</code>, starting at offset <code>off</code>. This method
+ * {@code len} bytes from the input stream into the array
+ * {@code b}, starting at offset {@code off}. This method
* blocks until the data is actually
* read. If the digest function is on (see
- * {@link #on(boolean) on}), this method will then call <code>update</code>
+ * {@link #on(boolean) on}), this method will then call {@code update}
* on the message digest associated with this stream, passing it
* the data.
*
* @param b the array into which the data is read.
*
- * @param off the starting offset into <code>b</code> of where the
+ * @param off the starting offset into {@code b} of where the
* data should be placed.
*
* @param len the maximum number of bytes to be read from the input
- * stream into b, starting at offset <code>off</code>.
+ * stream into b, starting at offset {@code off}.
*
* @return the actual number of bytes read. This is less than
- * <code>len</code> if the end of the stream is reached prior to
- * reading <code>len</code> bytes. -1 is returned if no bytes were
+ * {@code len} if the end of the stream is reached prior to
+ * reading {@code len} bytes. -1 is returned if no bytes were
* read because the end of the stream had already been reached when
* the call was made.
*
@@ -167,7 +167,7 @@
/**
* Turns the digest function on or off. The default is on. When
- * it is on, a call to one of the <code>read</code> methods results in an
+ * it is on, a call to one of the {@code read} methods results in an
* update on the message digest. But when it is off, the message
* digest is not updated.
*
diff --git a/ojluni/src/main/java/java/security/GeneralSecurityException.java b/ojluni/src/main/java/java/security/GeneralSecurityException.java
index 60b5688..dc9ea06 100644
--- a/ojluni/src/main/java/java/security/GeneralSecurityException.java
+++ b/ojluni/src/main/java/java/security/GeneralSecurityException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
package java.security;
/**
- * The <code>GeneralSecurityException</code> class is a generic
+ * The {@code GeneralSecurityException} class is a generic
* security exception class that provides type safety for all the
* security-related exception classes that extend from it.
*
@@ -57,13 +57,13 @@
}
/**
- * Creates a <code>GeneralSecurityException</code> with the specified
+ * Creates a {@code GeneralSecurityException} with the specified
* detail message and cause.
*
* @param message the detail message (which is saved for later retrieval
* by the {@link #getMessage()} method).
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
@@ -72,13 +72,13 @@
}
/**
- * Creates a <code>GeneralSecurityException</code> with the specified cause
- * and a detail message of <tt>(cause==null ? null : cause.toString())</tt>
+ * Creates a {@code GeneralSecurityException} with the specified cause
+ * and a detail message of {@code (cause==null ? null : cause.toString())}
* (which typically contains the class and detail message of
- * <tt>cause</tt>).
+ * {@code cause}).
*
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
diff --git a/ojluni/src/main/java/java/security/Guard.java b/ojluni/src/main/java/java/security/Guard.java
index 7cfd25b..abafb58 100644
--- a/ojluni/src/main/java/java/security/Guard.java
+++ b/ojluni/src/main/java/java/security/Guard.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,9 +29,9 @@
* <p> This interface represents a guard, which is an object that is used
* to protect access to another object.
*
- * <p>This interface contains a single method, <code>checkGuard</code>,
- * with a single <code>object</code> argument. <code>checkGuard</code> is
- * invoked (by the GuardedObject <code>getObject</code> method)
+ * <p>This interface contains a single method, {@code checkGuard},
+ * with a single {@code object} argument. {@code checkGuard} is
+ * invoked (by the GuardedObject {@code getObject} method)
* to determine whether or not to allow access to the object.
*
* @see GuardedObject
@@ -44,7 +44,7 @@
/**
* Determines whether or not to allow access to the guarded object
- * <code>object</code>. Returns silently if access is allowed.
+ * {@code object}. Returns silently if access is allowed.
* Otherwise, throws a SecurityException.
*
* @param object the object being protected by the guard.
diff --git a/ojluni/src/main/java/java/security/GuardedObject.java b/ojluni/src/main/java/java/security/GuardedObject.java
index c4edb23..a275ddf 100644
--- a/ojluni/src/main/java/java/security/GuardedObject.java
+++ b/ojluni/src/main/java/java/security/GuardedObject.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,9 +33,9 @@
* such that access to the target object is possible
* only if the Guard object allows it.
* Once an object is encapsulated by a GuardedObject,
- * access to that object is controlled by the <code>getObject</code>
+ * access to that object is controlled by the {@code getObject}
* method, which invokes the
- * <code>checkGuard</code> method on the Guard object that is
+ * {@code checkGuard} method on the Guard object that is
* guarding access. If access is not allowed,
* an exception is thrown.
*
diff --git a/ojluni/src/main/java/java/security/Identity.java b/ojluni/src/main/java/java/security/Identity.java
index 06446b8..e63131e 100644
--- a/ojluni/src/main/java/java/security/Identity.java
+++ b/ojluni/src/main/java/java/security/Identity.java
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2014 The Android Open Source Project
- * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -53,9 +53,9 @@
*
* @author Benjamin Renaud
* @deprecated This class is no longer used. Its functionality has been
- * replaced by <code>java.security.KeyStore</code>, the
- * <code>java.security.cert</code> package, and
- * <code>java.security.Principal</code>.
+ * replaced by {@code java.security.KeyStore}, the
+ * {@code java.security.cert} package, and
+ * {@code java.security.Principal}.
*/
@Deprecated
public abstract class Identity implements Principal, Serializable {
@@ -165,8 +165,8 @@
* Sets this identity's public key. The old key and all of this
* identity's certificates are removed by this operation.
*
- * <p>First, if there is a security manager, its <code>checkSecurityAccess</code>
- * method is called with <code>"setIdentityPublicKey"</code>
+ * <p>First, if there is a security manager, its {@code checkSecurityAccess}
+ * method is called with {@code "setIdentityPublicKey"}
* as its argument to see if it's ok to set the public key.
*
* @param key the public key for this identity.
@@ -175,7 +175,7 @@
* identity's scope has the same public key, or if another exception occurs.
*
* @exception SecurityException if a security manager exists and its
- * <code>checkSecurityAccess</code> method doesn't allow
+ * {@code checkSecurityAccess} method doesn't allow
* setting the public key.
*
* @see #getPublicKey
@@ -192,14 +192,14 @@
/**
* Specifies a general information string for this identity.
*
- * <p>First, if there is a security manager, its <code>checkSecurityAccess</code>
- * method is called with <code>"setIdentityInfo"</code>
+ * <p>First, if there is a security manager, its {@code checkSecurityAccess}
+ * method is called with {@code "setIdentityInfo"}
* as its argument to see if it's ok to specify the information string.
*
* @param info the information string.
*
* @exception SecurityException if a security manager exists and its
- * <code>checkSecurityAccess</code> method doesn't allow
+ * {@code checkSecurityAccess} method doesn't allow
* setting the information string.
*
* @see #getInfo
@@ -227,8 +227,8 @@
* the identity does not have a public key, the identity's
* public key is set to be that specified in the certificate.
*
- * <p>First, if there is a security manager, its <code>checkSecurityAccess</code>
- * method is called with <code>"addIdentityCertificate"</code>
+ * <p>First, if there is a security manager, its {@code checkSecurityAccess}
+ * method is called with {@code "addIdentityCertificate"}
* as its argument to see if it's ok to add a certificate.
*
* @param certificate the certificate to be added.
@@ -238,7 +238,7 @@
* this identity's public key, or if another exception occurs.
*
* @exception SecurityException if a security manager exists and its
- * <code>checkSecurityAccess</code> method doesn't allow
+ * {@code checkSecurityAccess} method doesn't allow
* adding a certificate.
*
* @see SecurityManager#checkSecurityAccess
@@ -262,7 +262,7 @@
certificates.addElement(certificate);
}
- private boolean keyEquals(Key aKey, Key anotherKey) {
+ private boolean keyEquals(PublicKey aKey, PublicKey anotherKey) {
String aKeyFormat = aKey.getFormat();
String anotherKeyFormat = anotherKey.getFormat();
if ((aKeyFormat == null) ^ (anotherKeyFormat == null))
@@ -278,8 +278,8 @@
/**
* Removes a certificate from this identity.
*
- * <p>First, if there is a security manager, its <code>checkSecurityAccess</code>
- * method is called with <code>"removeIdentityCertificate"</code>
+ * <p>First, if there is a security manager, its {@code checkSecurityAccess}
+ * method is called with {@code "removeIdentityCertificate"}
* as its argument to see if it's ok to remove a certificate.
*
* @param certificate the certificate to be removed.
@@ -288,7 +288,7 @@
* missing, or if another exception occurs.
*
* @exception SecurityException if a security manager exists and its
- * <code>checkSecurityAccess</code> method doesn't allow
+ * {@code checkSecurityAccess} method doesn't allow
* removing a certificate.
*
* @see SecurityManager#checkSecurityAccess
@@ -396,15 +396,15 @@
* Returns a short string describing this identity, telling its
* name and its scope (if any).
*
- * <p>First, if there is a security manager, its <code>checkSecurityAccess</code>
- * method is called with <code>"printIdentity"</code>
+ * <p>First, if there is a security manager, its {@code checkSecurityAccess}
+ * method is called with {@code "printIdentity"}
* as its argument to see if it's ok to return the string.
*
* @return information about this identity, such as its name and the
* name of its scope (if any).
*
* @exception SecurityException if a security manager exists and its
- * <code>checkSecurityAccess</code> method doesn't allow
+ * {@code checkSecurityAccess} method doesn't allow
* returning a string describing this identity.
*
* @see SecurityManager#checkSecurityAccess
@@ -421,20 +421,20 @@
/**
* Returns a string representation of this identity, with
* optionally more details than that provided by the
- * <code>toString</code> method without any arguments.
+ * {@code toString} method without any arguments.
*
- * <p>First, if there is a security manager, its <code>checkSecurityAccess</code>
- * method is called with <code>"printIdentity"</code>
+ * <p>First, if there is a security manager, its {@code checkSecurityAccess}
+ * method is called with {@code "printIdentity"}
* as its argument to see if it's ok to return the string.
*
* @param detailed whether or not to provide detailed information.
*
- * @return information about this identity. If <code>detailed</code>
+ * @return information about this identity. If {@code detailed}
* is true, then this method returns more information than that
- * provided by the <code>toString</code> method without any arguments.
+ * provided by the {@code toString} method without any arguments.
*
* @exception SecurityException if a security manager exists and its
- * <code>checkSecurityAccess</code> method doesn't allow
+ * {@code checkSecurityAccess} method doesn't allow
* returning a string describing this identity.
*
* @see #toString
diff --git a/ojluni/src/main/java/java/security/IdentityScope.java b/ojluni/src/main/java/java/security/IdentityScope.java
index b1789a8..65f4e98 100644
--- a/ojluni/src/main/java/java/security/IdentityScope.java
+++ b/ojluni/src/main/java/java/security/IdentityScope.java
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2014 The Android Open Source Project
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -58,9 +58,9 @@
* @author Benjamin Renaud
*
* @deprecated This class is no longer used. Its functionality has been
- * replaced by <code>java.security.KeyStore</code>, the
- * <code>java.security.cert</code> package, and
- * <code>java.security.Principal</code>.
+ * replaced by {@code java.security.KeyStore}, the
+ * {@code java.security.cert} package, and
+ * {@code java.security.Principal}.
*/
@Deprecated
public abstract
@@ -147,14 +147,14 @@
* Sets the system's identity scope.
*
* <p>First, if there is a security manager, its
- * <code>checkSecurityAccess</code>
- * method is called with <code>"setSystemScope"</code>
+ * {@code checkSecurityAccess}
+ * method is called with {@code "setSystemScope"}
* as its argument to see if it's ok to set the identity scope.
*
* @param scope the scope to set.
*
* @exception SecurityException if a security manager exists and its
- * <code>checkSecurityAccess</code> method doesn't allow
+ * {@code checkSecurityAccess} method doesn't allow
* setting the identity scope.
*
* @see #getSystemScope
@@ -177,8 +177,8 @@
*
* @param name the name of the identity to be retrieved.
*
- * @return the identity named <code>name</code>, or null if there are
- * no identities named <code>name</code> in this scope.
+ * @return the identity named {@code name}, or null if there are
+ * no identities named {@code name} in this scope.
*/
public abstract Identity getIdentity(String name);
diff --git a/ojluni/src/main/java/java/security/InvalidAlgorithmParameterException.java b/ojluni/src/main/java/java/security/InvalidAlgorithmParameterException.java
index b4f1a08..559a8be 100644
--- a/ojluni/src/main/java/java/security/InvalidAlgorithmParameterException.java
+++ b/ojluni/src/main/java/java/security/InvalidAlgorithmParameterException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -65,13 +65,13 @@
}
/**
- * Creates a <code>InvalidAlgorithmParameterException</code> with the
+ * Creates a {@code InvalidAlgorithmParameterException} with the
* specified detail message and cause.
*
* @param message the detail message (which is saved for later retrieval
* by the {@link #getMessage()} method).
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
@@ -80,14 +80,14 @@
}
/**
- * Creates a <code>InvalidAlgorithmParameterException</code> with the
+ * Creates a {@code InvalidAlgorithmParameterException} with the
* specified cause and a detail message of
- * <tt>(cause==null ? null : cause.toString())</tt>
+ * {@code (cause==null ? null : cause.toString())}
* (which typically contains the class and detail message of
- * <tt>cause</tt>).
+ * {@code cause}).
*
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
diff --git a/ojluni/src/main/java/java/security/InvalidKeyException.java b/ojluni/src/main/java/java/security/InvalidKeyException.java
index e9130f7..35fc64c 100644
--- a/ojluni/src/main/java/java/security/InvalidKeyException.java
+++ b/ojluni/src/main/java/java/security/InvalidKeyException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -58,13 +58,13 @@
}
/**
- * Creates a <code>InvalidKeyException</code> with the specified
+ * Creates a {@code InvalidKeyException} with the specified
* detail message and cause.
*
* @param message the detail message (which is saved for later retrieval
* by the {@link #getMessage()} method).
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
@@ -73,13 +73,13 @@
}
/**
- * Creates a <code>InvalidKeyException</code> with the specified cause
- * and a detail message of <tt>(cause==null ? null : cause.toString())</tt>
+ * Creates a {@code InvalidKeyException} with the specified cause
+ * and a detail message of {@code (cause==null ? null : cause.toString())}
* (which typically contains the class and detail message of
- * <tt>cause</tt>).
+ * {@code cause}).
*
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
diff --git a/ojluni/src/main/java/java/security/Key.java b/ojluni/src/main/java/java/security/Key.java
index e346b10..c8132f4 100644
--- a/ojluni/src/main/java/java/security/Key.java
+++ b/ojluni/src/main/java/java/security/Key.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@
* RSA), which will work with those algorithms and with related
* algorithms (such as MD5 with RSA, SHA-1 with RSA, Raw DSA, etc.)
* The name of the algorithm of a key is obtained using the
- * {@link #getAlgorithm() getAlgorithm} method.<P>
+ * {@link #getAlgorithm() getAlgorithm} method.
*
* <LI>An Encoded Form
*
@@ -47,9 +47,9 @@
* representation of the key is needed outside the Java Virtual Machine,
* as when transmitting the key to some other party. The key
* is encoded according to a standard format (such as
- * X.509 <code>SubjectPublicKeyInfo</code> or PKCS#8), and
+ * X.509 {@code SubjectPublicKeyInfo} or PKCS#8), and
* is returned using the {@link #getEncoded() getEncoded} method.
- * Note: The syntax of the ASN.1 type <code>SubjectPublicKeyInfo</code>
+ * Note: The syntax of the ASN.1 type {@code SubjectPublicKeyInfo}
* is defined as follows:
*
* <pre>
@@ -65,12 +65,11 @@
* For more information, see
* <a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280:
* Internet X.509 Public Key Infrastructure Certificate and CRL Profile</a>.
- * <P>
*
* <LI>A Format
*
* <P>This is the name of the format of the encoded key. It is returned
- * by the {@link #getFormat() getFormat} method.<P>
+ * by the {@link #getFormat() getFormat} method.
*
* </UL>
*
@@ -132,11 +131,11 @@
* For example, the name of the ASN.1 data format for public
* keys is <I>SubjectPublicKeyInfo</I>, as
* defined by the X.509 standard; in this case, the returned format is
- * <code>"X.509"</code>. Similarly,
+ * {@code "X.509"}. Similarly,
* the name of the ASN.1 data format for private keys is
* <I>PrivateKeyInfo</I>,
* as defined by the PKCS #8 standard; in this case, the returned format is
- * <code>"PKCS#8"</code>.
+ * {@code "PKCS#8"}.
*
* @return the primary encoding format of the key.
*/
diff --git a/ojluni/src/main/java/java/security/KeyException.java b/ojluni/src/main/java/java/security/KeyException.java
index cd79fcb..59cdd6f 100644
--- a/ojluni/src/main/java/java/security/KeyException.java
+++ b/ojluni/src/main/java/java/security/KeyException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -59,13 +59,13 @@
}
/**
- * Creates a <code>KeyException</code> with the specified
+ * Creates a {@code KeyException} with the specified
* detail message and cause.
*
* @param message the detail message (which is saved for later retrieval
* by the {@link #getMessage()} method).
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
@@ -74,13 +74,13 @@
}
/**
- * Creates a <code>KeyException</code> with the specified cause
- * and a detail message of <tt>(cause==null ? null : cause.toString())</tt>
+ * Creates a {@code KeyException} with the specified cause
+ * and a detail message of {@code (cause==null ? null : cause.toString())}
* (which typically contains the class and detail message of
- * <tt>cause</tt>).
+ * {@code cause}).
*
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
diff --git a/ojluni/src/main/java/java/security/KeyFactory.java b/ojluni/src/main/java/java/security/KeyFactory.java
index 865d553..92149ae 100644
--- a/ojluni/src/main/java/java/security/KeyFactory.java
+++ b/ojluni/src/main/java/java/security/KeyFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@
/**
* Key factories are used to convert <I>keys</I> (opaque
- * cryptographic keys of type <code>Key</code>) into <I>key specifications</I>
+ * cryptographic keys of type {@code Key}) into <I>key specifications</I>
* (transparent representations of the underlying key material), and vice
* versa.
*
@@ -47,8 +47,8 @@
*
* <P> Multiple compatible key specifications may exist for the same key.
* For example, a DSA public key may be specified using
- * <code>DSAPublicKeySpec</code> or
- * <code>X509EncodedKeySpec</code>. A key factory can be used to translate
+ * {@code DSAPublicKeySpec} or
+ * {@code X509EncodedKeySpec}. A key factory can be used to translate
* between compatible key specifications.
*
* <P> The following is an example of how to use a key factory in order to
@@ -143,7 +143,7 @@
* @param keyFacSpi the delegate
* @param provider the provider
* @param algorithm the name of the algorithm
- * to associate with this <tt>KeyFactory</tt>
+ * to associate with this {@code KeyFactory}
*/
protected KeyFactory(KeyFactorySpi keyFacSpi, Provider provider,
String algorithm) {
@@ -289,10 +289,10 @@
/**
* Gets the name of the algorithm
- * associated with this <tt>KeyFactory</tt>.
+ * associated with this {@code KeyFactory}.
*
* @return the name of the algorithm associated with this
- * <tt>KeyFactory</tt>
+ * {@code KeyFactory}
*/
public final String getAlgorithm() {
return this.algorithm;
@@ -412,11 +412,13 @@
/**
* Returns a specification (key material) of the given key object.
- * <code>keySpec</code> identifies the specification class in which
+ * {@code keySpec} identifies the specification class in which
* the key material should be returned. It could, for example, be
- * <code>DSAPublicKeySpec.class</code>, to indicate that the
+ * {@code DSAPublicKeySpec.class}, to indicate that the
* key material should be returned in an instance of the
- * <code>DSAPublicKeySpec</code> class.
+ * {@code DSAPublicKeySpec} class.
+ *
+ * @param <T> the type of the key specification to be returned
*
* @param key the key.
*
diff --git a/ojluni/src/main/java/java/security/KeyFactorySpi.java b/ojluni/src/main/java/java/security/KeyFactorySpi.java
index f1f4d4a..5ee7f45 100644
--- a/ojluni/src/main/java/java/security/KeyFactorySpi.java
+++ b/ojluni/src/main/java/java/security/KeyFactorySpi.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,13 +30,13 @@
/**
* This class defines the <i>Service Provider Interface</i> (<b>SPI</b>)
- * for the <code>KeyFactory</code> class.
+ * for the {@code KeyFactory} class.
* All the abstract methods in this class must be implemented by each
* cryptographic service provider who wishes to supply the implementation
* of a key factory for a particular algorithm.
*
* <P> Key factories are used to convert <I>keys</I> (opaque
- * cryptographic keys of type <code>Key</code>) into <I>key specifications</I>
+ * cryptographic keys of type {@code Key}) into <I>key specifications</I>
* (transparent representations of the underlying key material), and vice
* versa.
*
@@ -46,8 +46,8 @@
*
* <P> Multiple compatible key specifications may exist for the same key.
* For example, a DSA public key may be specified using
- * <code>DSAPublicKeySpec</code> or
- * <code>X509EncodedKeySpec</code>. A key factory can be used to translate
+ * {@code DSAPublicKeySpec} or
+ * {@code X509EncodedKeySpec}. A key factory can be used to translate
* between compatible key specifications.
*
* <P> A provider should document all the key specifications supported by its
@@ -100,11 +100,13 @@
/**
* Returns a specification (key material) of the given key
* object.
- * <code>keySpec</code> identifies the specification class in which
+ * {@code keySpec} identifies the specification class in which
* the key material should be returned. It could, for example, be
- * <code>DSAPublicKeySpec.class</code>, to indicate that the
+ * {@code DSAPublicKeySpec.class}, to indicate that the
* key material should be returned in an instance of the
- * <code>DSAPublicKeySpec</code> class.
+ * {@code DSAPublicKeySpec} class.
+ *
+ * @param <T> the type of the key specification to be returned
*
* @param key the key.
*
diff --git a/ojluni/src/main/java/java/security/KeyManagementException.java b/ojluni/src/main/java/java/security/KeyManagementException.java
index 403e36a..be212b9 100644
--- a/ojluni/src/main/java/java/security/KeyManagementException.java
+++ b/ojluni/src/main/java/java/security/KeyManagementException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -68,13 +68,13 @@
}
/**
- * Creates a <code>KeyManagementException</code> with the specified
+ * Creates a {@code KeyManagementException} with the specified
* detail message and cause.
*
* @param message the detail message (which is saved for later retrieval
* by the {@link #getMessage()} method).
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
@@ -83,13 +83,13 @@
}
/**
- * Creates a <code>KeyManagementException</code> with the specified cause
- * and a detail message of <tt>(cause==null ? null : cause.toString())</tt>
+ * Creates a {@code KeyManagementException} with the specified cause
+ * and a detail message of {@code (cause==null ? null : cause.toString())}
* (which typically contains the class and detail message of
- * <tt>cause</tt>).
+ * {@code cause}).
*
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
diff --git a/ojluni/src/main/java/java/security/KeyPair.java b/ojluni/src/main/java/java/security/KeyPair.java
index 1681553..6147a16 100644
--- a/ojluni/src/main/java/java/security/KeyPair.java
+++ b/ojluni/src/main/java/java/security/KeyPair.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@
*
* <p>Note that this constructor only stores references to the public
* and private key components in the generated key pair. This is safe,
- * because <code>Key</code> objects are immutable.
+ * because {@code Key} objects are immutable.
*
* @param publicKey the public key.
*
diff --git a/ojluni/src/main/java/java/security/KeyPairGenerator.java b/ojluni/src/main/java/java/security/KeyPairGenerator.java
index 9413d11..cbdaf3e 100644
--- a/ojluni/src/main/java/java/security/KeyPairGenerator.java
+++ b/ojluni/src/main/java/java/security/KeyPairGenerator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -34,10 +34,15 @@
import sun.security.jca.*;
import sun.security.jca.GetInstance.Instance;
+/*
+ANDROID-REMOVED: this debugging mechanism is not supported in Android.
+import sun.security.util.Debug;
+*/
+
/**
* The KeyPairGenerator class is used to generate pairs of
* public and private keys. Key pair generators are constructed using the
- * <code>getInstance</code> factory methods (static methods that
+ * {@code getInstance} factory methods (static methods that
* return instances of a given class).
*
* <p>A Key pair generator for a particular algorithm creates a public/private
@@ -58,50 +63,49 @@
* {@link #initialize(int, java.security.SecureRandom) initialize}
* method in this KeyPairGenerator class that takes these two universally
* shared types of arguments. There is also one that takes just a
- * <code>keysize</code> argument, and uses the <code>SecureRandom</code>
+ * {@code keysize} argument, and uses the {@code SecureRandom}
* implementation of the highest-priority installed provider as the source
* of randomness. (If none of the installed providers supply an implementation
- * of <code>SecureRandom</code>, a system-provided source of randomness is
+ * of {@code SecureRandom}, a system-provided source of randomness is
* used.)
*
* <p>Since no other parameters are specified when you call the above
- * algorithm-independent <code>initialize</code> methods, it is up to the
+ * algorithm-independent {@code initialize} methods, it is up to the
* provider what to do about the algorithm-specific parameters (if any) to be
* associated with each of the keys.
*
* <p>If the algorithm is the <i>DSA</i> algorithm, and the keysize (modulus
* size) is 512, 768, or 1024, then the <i>Sun</i> provider uses a set of
- * precomputed values for the <code>p</code>, <code>q</code>, and
- * <code>g</code> parameters. If the modulus size is not one of the above
+ * precomputed values for the {@code p}, {@code q}, and
+ * {@code g} parameters. If the modulus size is not one of the above
* values, the <i>Sun</i> provider creates a new set of parameters. Other
* providers might have precomputed parameter sets for more than just the
* three modulus sizes mentioned above. Still others might not have a list of
* precomputed parameters at all and instead always create new parameter sets.
- * <p>
*
* <li><b>Algorithm-Specific Initialization</b>
* <p>For situations where a set of algorithm-specific parameters already
* exists (e.g., so-called <i>community parameters</i> in DSA), there are two
* {@link #initialize(java.security.spec.AlgorithmParameterSpec)
- * initialize} methods that have an <code>AlgorithmParameterSpec</code>
- * argument. One also has a <code>SecureRandom</code> argument, while the
- * the other uses the <code>SecureRandom</code>
+ * initialize} methods that have an {@code AlgorithmParameterSpec}
+ * argument. One also has a {@code SecureRandom} argument, while the
+ * the other uses the {@code SecureRandom}
* implementation of the highest-priority installed provider as the source
* of randomness. (If none of the installed providers supply an implementation
- * of <code>SecureRandom</code>, a system-provided source of randomness is
+ * of {@code SecureRandom}, a system-provided source of randomness is
* used.)
* </ul>
*
* <p>In case the client does not explicitly initialize the KeyPairGenerator
- * (via a call to an <code>initialize</code> method), each provider must
+ * (via a call to an {@code initialize} method), each provider must
* supply (and document) a default initialization.
* For example, the <i>Sun</i> provider uses a default modulus size (keysize)
* of 1024 bits.
*
* <p>Note that this class is abstract and extends from
- * <code>KeyPairGeneratorSpi</code> for historical reasons.
+ * {@code KeyPairGeneratorSpi} for historical reasons.
* Application developers should only take notice of the methods defined in
- * this <code>KeyPairGenerator</code> class; all the methods in
+ * this {@code KeyPairGenerator} class; all the methods in
* the superclass are intended for cryptographic service providers who wish to
* supply their own implementations of key pair generators.
*
@@ -145,6 +149,14 @@
public abstract class KeyPairGenerator extends KeyPairGeneratorSpi {
+ /*
+ ANDROID-REMOVED: this debugging mechanism is not supported in Android.
+ private static final Debug pdebug =
+ Debug.getInstance("provider", "Provider");
+ private static final boolean skipDebug =
+ Debug.isOn("engine=") && !Debug.isOn("keypairgenerator");
+ */
+
private final String algorithm;
// The provider
@@ -186,6 +198,15 @@
kpg = new Delegate(spi, algorithm);
}
kpg.provider = instance.provider;
+
+ /*
+ ANDROID-REMOVED: this debugging mechanism is not supported in Android.
+ if (!skipDebug && pdebug != null) {
+ pdebug.println("KeyPairGenerator." + algorithm +
+ " algorithm from: " + kpg.provider.getName());
+ }
+ */
+
return kpg;
}
@@ -340,18 +361,18 @@
/**
* Initializes the key pair generator for a certain keysize using
- * a default parameter set and the <code>SecureRandom</code>
+ * a default parameter set and the {@code SecureRandom}
* implementation of the highest-priority installed provider as the source
* of randomness.
* (If none of the installed providers supply an implementation of
- * <code>SecureRandom</code>, a system-provided source of randomness is
+ * {@code SecureRandom}, a system-provided source of randomness is
* used.)
*
* @param keysize the keysize. This is an
* algorithm-specific metric, such as modulus length, specified in
* number of bits.
*
- * @exception InvalidParameterException if the <code>keysize</code> is not
+ * @exception InvalidParameterException if the {@code keysize} is not
* supported by this KeyPairGenerator object.
*/
public void initialize(int keysize) {
@@ -367,7 +388,7 @@
* number of bits.
* @param random the source of randomness.
*
- * @exception InvalidParameterException if the <code>keysize</code> is not
+ * @exception InvalidParameterException if the {@code keysize} is not
* supported by this KeyPairGenerator object.
*
* @since 1.2
@@ -387,11 +408,11 @@
/**
* Initializes the key pair generator using the specified parameter
- * set and the <code>SecureRandom</code>
+ * set and the {@code SecureRandom}
* implementation of the highest-priority installed provider as the source
* of randomness.
* (If none of the installed providers supply an implementation of
- * <code>SecureRandom</code>, a system-provided source of randomness is
+ * {@code SecureRandom}, a system-provided source of randomness is
* used.).
*
* <p>This concrete method has been added to this previously-defined
@@ -400,10 +421,10 @@
* {@link KeyPairGeneratorSpi#initialize(
* java.security.spec.AlgorithmParameterSpec,
* java.security.SecureRandom) initialize} method,
- * passing it <code>params</code> and a source of randomness (obtained
+ * passing it {@code params} and a source of randomness (obtained
* from the highest-priority installed provider or system-provided if none
* of the installed providers supply one).
- * That <code>initialize</code> method always throws an
+ * That {@code initialize} method always throws an
* UnsupportedOperationException if it is not overridden by the provider.
*
* @param params the parameter set used to generate the keys.
@@ -428,8 +449,8 @@
* KeyPairGeneratorSpi#initialize(
* java.security.spec.AlgorithmParameterSpec,
* java.security.SecureRandom) initialize} method,
- * passing it <code>params</code> and <code>random</code>.
- * That <code>initialize</code>
+ * passing it {@code params} and {@code random}.
+ * That {@code initialize}
* method always throws an
* UnsupportedOperationException if it is not overridden by the provider.
*
@@ -576,6 +597,14 @@
provider = instance.provider;
this.serviceIterator = serviceIterator;
initType = I_NONE;
+
+ /*
+ ANDROID-REMOVED: this debugging mechanism is not supported in Android.
+ if (!skipDebug && pdebug != null) {
+ pdebug.println("KeyPairGenerator." + algorithm +
+ " algorithm from: " + provider.getName());
+ }
+ */
}
/**
diff --git a/ojluni/src/main/java/java/security/KeyPairGeneratorSpi.java b/ojluni/src/main/java/java/security/KeyPairGeneratorSpi.java
index 28139ad..dfe8c04 100644
--- a/ojluni/src/main/java/java/security/KeyPairGeneratorSpi.java
+++ b/ojluni/src/main/java/java/security/KeyPairGeneratorSpi.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
/**
* <p> This class defines the <i>Service Provider Interface</i> (<b>SPI</b>)
- * for the <code>KeyPairGenerator</code> class, which is used to generate
+ * for the {@code KeyPairGenerator} class, which is used to generate
* pairs of public and private keys.
*
* <p> All the abstract methods in this class must be implemented by each
@@ -37,7 +37,7 @@
* of a key pair generator for a particular algorithm.
*
* <p> In case the client does not explicitly initialize the KeyPairGenerator
- * (via a call to an <code>initialize</code> method), each provider must
+ * (via a call to an {@code initialize} method), each provider must
* supply (and document) a default initialization.
* For example, the <i>Sun</i> provider uses a default modulus size (keysize)
* of 1024 bits.
@@ -61,7 +61,7 @@
*
* @param random the source of randomness for this generator.
*
- * @exception InvalidParameterException if the <code>keysize</code> is not
+ * @exception InvalidParameterException if the {@code keysize} is not
* supported by this KeyPairGeneratorSpi object.
*/
public abstract void initialize(int keysize, SecureRandom random);
@@ -100,7 +100,7 @@
* will be used. This will generate a new key pair every time it
* is called.
*
- * @return the newly generated <tt>KeyPair</tt>
+ * @return the newly generated {@code KeyPair}
*/
public abstract KeyPair generateKeyPair();
}
diff --git a/ojluni/src/main/java/java/security/KeyRep.java b/ojluni/src/main/java/java/security/KeyRep.java
index 80a9b03..97a6c16 100644
--- a/ojluni/src/main/java/java/security/KeyRep.java
+++ b/ojluni/src/main/java/java/security/KeyRep.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
package java.security;
import java.io.*;
+import java.util.Locale;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
@@ -115,17 +116,17 @@
*
* @param type either one of Type.SECRET, Type.PUBLIC, or Type.PRIVATE
* @param algorithm the algorithm returned from
- * <code>Key.getAlgorithm()</code>
+ * {@code Key.getAlgorithm()}
* @param format the encoding format returned from
- * <code>Key.getFormat()</code>
+ * {@code Key.getFormat()}
* @param encoded the encoded bytes returned from
- * <code>Key.getEncoded()</code>
+ * {@code Key.getEncoded()}
*
* @exception NullPointerException
- * if type is <code>null</code>,
- * if algorithm is <code>null</code>,
- * if format is <code>null</code>,
- * or if encoded is <code>null</code>
+ * if type is {@code null},
+ * if algorithm is {@code null},
+ * if format is {@code null},
+ * or if encoded is {@code null}
*/
public KeyRep(Type type, String algorithm,
String format, byte[] encoded) {
@@ -137,7 +138,7 @@
this.type = type;
this.algorithm = algorithm;
- this.format = format.toUpperCase();
+ this.format = format.toUpperCase(Locale.ENGLISH);
this.encoded = encoded.clone();
}
diff --git a/ojluni/src/main/java/java/security/KeyStoreException.java b/ojluni/src/main/java/java/security/KeyStoreException.java
index 707a558..cf56d6a 100644
--- a/ojluni/src/main/java/java/security/KeyStoreException.java
+++ b/ojluni/src/main/java/java/security/KeyStoreException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -59,13 +59,13 @@
}
/**
- * Creates a <code>KeyStoreException</code> with the specified
+ * Creates a {@code KeyStoreException} with the specified
* detail message and cause.
*
* @param message the detail message (which is saved for later retrieval
* by the {@link #getMessage()} method).
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
@@ -74,13 +74,13 @@
}
/**
- * Creates a <code>KeyStoreException</code> with the specified cause
- * and a detail message of <tt>(cause==null ? null : cause.toString())</tt>
+ * Creates a {@code KeyStoreException} with the specified cause
+ * and a detail message of {@code (cause==null ? null : cause.toString())}
* (which typically contains the class and detail message of
- * <tt>cause</tt>).
+ * {@code cause}).
*
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
diff --git a/ojluni/src/main/java/java/security/KeyStoreSpi.java b/ojluni/src/main/java/java/security/KeyStoreSpi.java
index 4035782..4caa59c 100644
--- a/ojluni/src/main/java/java/security/KeyStoreSpi.java
+++ b/ojluni/src/main/java/java/security/KeyStoreSpi.java
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2014 The Android Open Source Project
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@
/**
* This class defines the <i>Service Provider Interface</i> (<b>SPI</b>)
- * for the <code>KeyStore</code> class.
+ * for the {@code KeyStore} class.
* All the abstract methods in this class must be implemented by each
* cryptographic service provider who wishes to supply the implementation
* of a keystore for a particular keystore type.
@@ -56,9 +56,9 @@
/**
* Returns the key associated with the given alias, using the given
* password to recover it. The key must have been associated with
- * the alias by a call to <code>setKeyEntry</code>,
- * or by a call to <code>setEntry</code> with a
- * <code>PrivateKeyEntry</code> or <code>SecretKeyEntry</code>.
+ * the alias by a call to {@code setKeyEntry},
+ * or by a call to {@code setEntry} with a
+ * {@code PrivateKeyEntry} or {@code SecretKeyEntry}.
*
* @param alias the alias name
* @param password the password for recovering the key
@@ -77,9 +77,9 @@
/**
* Returns the certificate chain associated with the given alias.
* The certificate chain must have been associated with the alias
- * by a call to <code>setKeyEntry</code>,
- * or by a call to <code>setEntry</code> with a
- * <code>PrivateKeyEntry</code>.
+ * by a call to {@code setKeyEntry},
+ * or by a call to {@code setEntry} with a
+ * {@code PrivateKeyEntry}.
*
* @param alias the alias name
*
@@ -93,15 +93,15 @@
* Returns the certificate associated with the given alias.
*
* <p> If the given alias name identifies an entry
- * created by a call to <code>setCertificateEntry</code>,
- * or created by a call to <code>setEntry</code> with a
- * <code>TrustedCertificateEntry</code>,
+ * created by a call to {@code setCertificateEntry},
+ * or created by a call to {@code setEntry} with a
+ * {@code TrustedCertificateEntry},
* then the trusted certificate contained in that entry is returned.
*
* <p> If the given alias name identifies an entry
- * created by a call to <code>setKeyEntry</code>,
- * or created by a call to <code>setEntry</code> with a
- * <code>PrivateKeyEntry</code>,
+ * created by a call to {@code setKeyEntry},
+ * or created by a call to {@code setEntry} with a
+ * {@code PrivateKeyEntry},
* then the first element of the certificate chain in that entry
* (if a chain exists) is returned.
*
@@ -126,7 +126,7 @@
* Assigns the given key to the given alias, protecting it with the given
* password.
*
- * <p>If the given key is of type <code>java.security.PrivateKey</code>,
+ * <p>If the given key is of type {@code java.security.PrivateKey},
* it must be accompanied by a certificate chain certifying the
* corresponding public key.
*
@@ -139,7 +139,7 @@
* @param password the password to protect the key
* @param chain the certificate chain for the corresponding public
* key (only required if the given key is of type
- * <code>java.security.PrivateKey</code>).
+ * {@code java.security.PrivateKey}).
*
* @exception KeyStoreException if the given key cannot be protected, or
* this operation fails for some other reason
@@ -154,7 +154,7 @@
* alias.
*
* <p>If the protected key is of type
- * <code>java.security.PrivateKey</code>,
+ * {@code java.security.PrivateKey},
* it must be accompanied by a certificate chain certifying the
* corresponding public key.
*
@@ -166,7 +166,7 @@
* @param key the key (in protected format) to be associated with the alias
* @param chain the certificate chain for the corresponding public
* key (only useful if the protected key is of type
- * <code>java.security.PrivateKey</code>).
+ * {@code java.security.PrivateKey}).
*
* @exception KeyStoreException if this operation fails.
*/
@@ -178,9 +178,9 @@
* Assigns the given certificate to the given alias.
*
* <p> If the given alias identifies an existing entry
- * created by a call to <code>setCertificateEntry</code>,
- * or created by a call to <code>setEntry</code> with a
- * <code>TrustedCertificateEntry</code>,
+ * created by a call to {@code setCertificateEntry},
+ * or created by a call to {@code setEntry} with a
+ * {@code TrustedCertificateEntry},
* the trusted certificate in the existing entry
* is overridden by the given certificate.
*
@@ -230,9 +230,9 @@
/**
* Returns true if the entry identified by the given alias
- * was created by a call to <code>setKeyEntry</code>,
- * or created by a call to <code>setEntry</code> with a
- * <code>PrivateKeyEntry</code> or a <code>SecretKeyEntry</code>.
+ * was created by a call to {@code setKeyEntry},
+ * or created by a call to {@code setEntry} with a
+ * {@code PrivateKeyEntry} or a {@code SecretKeyEntry}.
*
* @param alias the alias for the keystore entry to be checked
*
@@ -243,9 +243,9 @@
/**
* Returns true if the entry identified by the given alias
- * was created by a call to <code>setCertificateEntry</code>,
- * or created by a call to <code>setEntry</code> with a
- * <code>TrustedCertificateEntry</code>.
+ * was created by a call to {@code setCertificateEntry},
+ * or created by a call to {@code setEntry} with a
+ * {@code TrustedCertificateEntry}.
*
* @param alias the alias for the keystore entry to be checked
*
@@ -260,15 +260,15 @@
*
* <p>This method attempts to match the given certificate with each
* keystore entry. If the entry being considered was
- * created by a call to <code>setCertificateEntry</code>,
- * or created by a call to <code>setEntry</code> with a
- * <code>TrustedCertificateEntry</code>,
+ * created by a call to {@code setCertificateEntry},
+ * or created by a call to {@code setEntry} with a
+ * {@code TrustedCertificateEntry},
* then the given certificate is compared to that entry's certificate.
*
* <p> If the entry being considered was
- * created by a call to <code>setKeyEntry</code>,
- * or created by a call to <code>setEntry</code> with a
- * <code>PrivateKeyEntry</code>,
+ * created by a call to {@code setKeyEntry},
+ * or created by a call to {@code setEntry} with a
+ * {@code PrivateKeyEntry},
* then the given certificate is compared to the first
* element of that entry's certificate chain.
*
@@ -297,14 +297,14 @@
/**
* Stores this keystore using the given
- * <code>KeyStore.LoadStoreParmeter</code>.
+ * {@code KeyStore.LoadStoreParmeter}.
*
- * @param param the <code>KeyStore.LoadStoreParmeter</code>
+ * @param param the {@code KeyStore.LoadStoreParmeter}
* that specifies how to store the keystore,
- * which may be <code>null</code>
+ * which may be {@code null}
*
* @exception IllegalArgumentException if the given
- * <code>KeyStore.LoadStoreParmeter</code>
+ * {@code KeyStore.LoadStoreParmeter}
* input is not recognized
* @exception IOException if there was an I/O problem with data
* @exception NoSuchAlgorithmException if the appropriate data integrity
@@ -330,17 +330,17 @@
* then integrity checking is not performed.
*
* @param stream the input stream from which the keystore is loaded,
- * or <code>null</code>
+ * or {@code null}
* @param password the password used to check the integrity of
* the keystore, the password used to unlock the keystore,
- * or <code>null</code>
+ * or {@code null}
*
* @exception IOException if there is an I/O or format problem with the
* keystore data, if a password is required but not given,
* or if the given password was incorrect. If the error is due to a
* wrong password, the {@link Throwable#getCause cause} of the
- * <code>IOException</code> should be an
- * <code>UnrecoverableKeyException</code>
+ * {@code IOException} should be an
+ * {@code UnrecoverableKeyException}
* @exception NoSuchAlgorithmException if the algorithm used to check
* the integrity of the keystore cannot be found
* @exception CertificateException if any of the certificates in the
@@ -351,24 +351,24 @@
/**
* Loads the keystore using the given
- * <code>KeyStore.LoadStoreParameter</code>.
+ * {@code KeyStore.LoadStoreParameter}.
*
* <p> Note that if this KeyStore has already been loaded, it is
* reinitialized and loaded again from the given parameter.
*
- * @param param the <code>KeyStore.LoadStoreParameter</code>
+ * @param param the {@code KeyStore.LoadStoreParameter}
* that specifies how to load the keystore,
- * which may be <code>null</code>
+ * which may be {@code null}
*
* @exception IllegalArgumentException if the given
- * <code>KeyStore.LoadStoreParameter</code>
+ * {@code KeyStore.LoadStoreParameter}
* input is not recognized
* @exception IOException if there is an I/O or format problem with the
* keystore data. If the error is due to an incorrect
- * <code>ProtectionParameter</code> (e.g. wrong password)
+ * {@code ProtectionParameter} (e.g. wrong password)
* the {@link Throwable#getCause cause} of the
- * <code>IOException</code> should be an
- * <code>UnrecoverableKeyException</code>
+ * {@code IOException} should be an
+ * {@code UnrecoverableKeyException}
* @exception NoSuchAlgorithmException if the algorithm used to check
* the integrity of the keystore cannot be found
* @exception CertificateException if any of the certificates in the
@@ -419,25 +419,25 @@
}
/**
- * Gets a <code>KeyStore.Entry</code> for the specified alias
+ * Gets a {@code KeyStore.Entry} for the specified alias
* with the specified protection parameter.
*
- * @param alias get the <code>KeyStore.Entry</code> for this alias
- * @param protParam the <code>ProtectionParameter</code>
- * used to protect the <code>Entry</code>,
- * which may be <code>null</code>
+ * @param alias get the {@code KeyStore.Entry} for this alias
+ * @param protParam the {@code ProtectionParameter}
+ * used to protect the {@code Entry},
+ * which may be {@code null}
*
- * @return the <code>KeyStore.Entry</code> for the specified alias,
- * or <code>null</code> if there is no such entry
+ * @return the {@code KeyStore.Entry} for the specified alias,
+ * or {@code null} if there is no such entry
*
* @exception KeyStoreException if the operation failed
* @exception NoSuchAlgorithmException if the algorithm for recovering the
* entry cannot be found
* @exception UnrecoverableEntryException if the specified
- * <code>protParam</code> were insufficient or invalid
+ * {@code protParam} were insufficient or invalid
* @exception UnrecoverableKeyException if the entry is a
- * <code>PrivateKeyEntry</code> or <code>SecretKeyEntry</code>
- * and the specified <code>protParam</code> does not contain
+ * {@code PrivateKeyEntry} or {@code SecretKeyEntry}
+ * and the specified {@code protParam} does not contain
* the information needed to recover the key (e.g. wrong password)
*
* @since 1.5
@@ -483,18 +483,18 @@
}
/**
- * Saves a <code>KeyStore.Entry</code> under the specified alias.
+ * Saves a {@code KeyStore.Entry} under the specified alias.
* The specified protection parameter is used to protect the
- * <code>Entry</code>.
+ * {@code Entry}.
*
* <p> If an entry already exists for the specified alias,
* it is overridden.
*
- * @param alias save the <code>KeyStore.Entry</code> under this alias
- * @param entry the <code>Entry</code> to save
- * @param protParam the <code>ProtectionParameter</code>
- * used to protect the <code>Entry</code>,
- * which may be <code>null</code>
+ * @param alias save the {@code KeyStore.Entry} under this alias
+ * @param entry the {@code Entry} to save
+ * @param protParam the {@code ProtectionParameter}
+ * used to protect the {@code Entry},
+ * which may be {@code null}
*
* @exception KeyStoreException if this operation fails
*
@@ -542,16 +542,16 @@
}
/**
- * Determines if the keystore <code>Entry</code> for the specified
- * <code>alias</code> is an instance or subclass of the specified
- * <code>entryClass</code>.
+ * Determines if the keystore {@code Entry} for the specified
+ * {@code alias} is an instance or subclass of the specified
+ * {@code entryClass}.
*
* @param alias the alias name
* @param entryClass the entry class
*
- * @return true if the keystore <code>Entry</code> for the specified
- * <code>alias</code> is an instance or subclass of the
- * specified <code>entryClass</code>, false otherwise
+ * @return true if the keystore {@code Entry} for the specified
+ * {@code alias} is an instance or subclass of the
+ * specified {@code entryClass}, false otherwise
*
* @since 1.5
*/
diff --git a/ojluni/src/main/java/java/security/MessageDigest.java b/ojluni/src/main/java/java/security/MessageDigest.java
index ff7f544..11dae4b 100644
--- a/ojluni/src/main/java/java/security/MessageDigest.java
+++ b/ojluni/src/main/java/java/security/MessageDigest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, 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
@@ -35,6 +35,10 @@
import java.nio.ByteBuffer;
+/*
+ANDROID-REMOVED: this debugging mechanism is not available in Android.
+import sun.security.util.Debug;
+*/
/**
* This MessageDigest class provides applications the functionality of a
* message digest algorithm, such as SHA-1 or SHA-256.
@@ -48,36 +52,36 @@
* updated, one of the {@link #digest() digest} methods should
* be called to complete the hash computation.
*
- * <p>The <code>digest</code> method can be called once for a given number
- * of updates. After <code>digest</code> has been called, the MessageDigest
+ * <p>The {@code digest} method can be called once for a given number
+ * of updates. After {@code digest} has been called, the MessageDigest
* object is reset to its initialized state.
*
* <p>Implementations are free to implement the Cloneable interface.
* Client applications can test cloneability by attempting cloning
- * and catching the CloneNotSupportedException: <p>
+ * and catching the CloneNotSupportedException:
*
-* <pre>
-* MessageDigest md = MessageDigest.getInstance("SHA");
-*
-* try {
-* md.update(toChapter1);
-* MessageDigest tc1 = md.clone();
-* byte[] toChapter1Digest = tc1.digest();
-* md.update(toChapter2);
-* ...etc.
-* } catch (CloneNotSupportedException cnse) {
-* throw new DigestException("couldn't make digest of partial content");
-* }
-* </pre>
+ * <pre>{@code
+ * MessageDigest md = MessageDigest.getInstance("SHA");
+ *
+ * try {
+ * md.update(toChapter1);
+ * MessageDigest tc1 = md.clone();
+ * byte[] toChapter1Digest = tc1.digest();
+ * md.update(toChapter2);
+ * ...etc.
+ * } catch (CloneNotSupportedException cnse) {
+ * throw new DigestException("couldn't make digest of partial content");
+ * }
+ * }</pre>
*
* <p>Note that if a given implementation is not cloneable, it is
* still possible to compute intermediate digests by instantiating
* several instances, if the number of digests is known in advance.
*
* <p>Note that this class is abstract and extends from
- * <code>MessageDigestSpi</code> for historical reasons.
+ * {@code MessageDigestSpi} for historical reasons.
* Application developers should only take notice of the methods defined in
- * this <code>MessageDigest</code> class; all the methods in
+ * this {@code MessageDigest} class; all the methods in
* the superclass are intended for cryptographic service providers who wish to
* supply their own implementations of message digest algorithms.
*
@@ -130,6 +134,14 @@
public abstract class MessageDigest extends MessageDigestSpi {
+ /*
+ ANDROID-REMOVED: this debugging mechanism is not available in Android.
+ private static final Debug pdebug =
+ Debug.getInstance("provider", "Provider");
+ private static final boolean skipDebug =
+ Debug.isOn("engine=") && !Debug.isOn("messagedigest");
+ */
+
private String algorithm;
// The state of this digest
@@ -183,18 +195,26 @@
public static MessageDigest getInstance(String algorithm)
throws NoSuchAlgorithmException {
try {
+ MessageDigest md;
Object[] objs = Security.getImpl(algorithm, "MessageDigest",
(String)null);
if (objs[0] instanceof MessageDigest) {
- MessageDigest md = (MessageDigest)objs[0];
- md.provider = (Provider)objs[1];
- return md;
+ md = (MessageDigest)objs[0];
} else {
- MessageDigest delegate =
- new Delegate((MessageDigestSpi)objs[0], algorithm);
- delegate.provider = (Provider)objs[1];
- return delegate;
+ md = new Delegate((MessageDigestSpi)objs[0], algorithm);
}
+ md.provider = (Provider)objs[1];
+
+ /*
+ ANDROID-REMOVED: this debugging mechanism is not available in Android.
+ if (!skipDebug && pdebug != null) {
+ pdebug.println("MessageDigest." + algorithm +
+ " algorithm from: " + md.provider.getName());
+ }
+ */
+
+ return md;
+
} catch(NoSuchProviderException e) {
throw new NoSuchAlgorithmException(algorithm + " not found");
}
@@ -328,7 +348,7 @@
* @param offset the offset to start from in the array of bytes.
*
* @param len the number of bytes to use, starting at
- * <code>offset</code>.
+ * {@code offset}.
*/
public void update(byte[] input, int offset, int len) {
if (input == null) {
@@ -353,8 +373,8 @@
/**
* Update the digest using the specified ByteBuffer. The digest is
- * updated using the <code>input.remaining()</code> bytes starting
- * at <code>input.position()</code>.
+ * updated using the {@code input.remaining()} bytes starting
+ * at {@code input.position()}.
* Upon return, the buffer's position will be equal to its limit;
* its limit will not have changed.
*
@@ -392,7 +412,7 @@
*
* @param len number of bytes within buf allotted for the digest
*
- * @return the number of bytes placed into <code>buf</code>
+ * @return the number of bytes placed into {@code buf}
*
* @exception DigestException if an error occurs.
*/
@@ -413,7 +433,7 @@
* Performs a final update on the digest using the specified array
* of bytes, then completes the digest computation. That is, this
* method first calls {@link #update(byte[]) update(input)},
- * passing the <i>input</i> array to the <code>update</code> method,
+ * passing the <i>input</i> array to the {@code update} method,
* then calls {@link #digest() digest()}.
*
* @param input the input to be updated before the digest is
@@ -458,6 +478,10 @@
* @return true if the digests are equal, false otherwise.
*/
public static boolean isEqual(byte[] digesta, byte[] digestb) {
+ if (digesta == digestb) return true;
+ if (digesta == null || digestb == null) {
+ return false;
+ }
if (digesta.length != digestb.length) {
return false;
}
@@ -522,7 +546,7 @@
* @return a clone if the implementation is cloneable.
*
* @exception CloneNotSupportedException if this is called on an
- * implementation that does not support <code>Cloneable</code>.
+ * implementation that does not support {@code Cloneable}.
*/
public Object clone() throws CloneNotSupportedException {
if (this instanceof Cloneable) {
@@ -566,7 +590,7 @@
* @return a clone if the delegate is cloneable.
*
* @exception CloneNotSupportedException if this is called on a
- * delegate that does not support <code>Cloneable</code>.
+ * delegate that does not support {@code Cloneable}.
*/
public Object clone() throws CloneNotSupportedException {
if (digestSpi instanceof Cloneable) {
diff --git a/ojluni/src/main/java/java/security/MessageDigestSpi.java b/ojluni/src/main/java/java/security/MessageDigestSpi.java
index 700d725..0d5ace1 100644
--- a/ojluni/src/main/java/java/security/MessageDigestSpi.java
+++ b/ojluni/src/main/java/java/security/MessageDigestSpi.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,7 @@
/**
* This class defines the <i>Service Provider Interface</i> (<b>SPI</b>)
- * for the <code>MessageDigest</code> class, which provides the functionality
+ * for the {@code MessageDigest} class, which provides the functionality
* of a message digest algorithm, such as MD5 or SHA. Message digests are
* secure one-way hash functions that take arbitrary-sized data and output a
* fixed-length hash value.
@@ -88,14 +88,14 @@
* @param offset the offset to start from in the array of bytes.
*
* @param len the number of bytes to use, starting at
- * <code>offset</code>.
+ * {@code offset}.
*/
protected abstract void engineUpdate(byte[] input, int offset, int len);
/**
* Update the digest using the specified ByteBuffer. The digest is
- * updated using the <code>input.remaining()</code> bytes starting
- * at <code>input.position()</code>.
+ * updated using the {@code input.remaining()} bytes starting
+ * at {@code input.position()}.
* Upon return, the buffer's position will be equal to its limit;
* its limit will not have changed.
*
@@ -130,7 +130,7 @@
/**
* Completes the hash computation by performing final
- * operations such as padding. Once <code>engineDigest</code> has
+ * operations such as padding. Once {@code engineDigest} has
* been called, the engine should be reset (see
* {@link #engineReset() engineReset}).
* Resetting is the responsibility of the
@@ -142,7 +142,7 @@
/**
* Completes the hash computation by performing final
- * operations such as padding. Once <code>engineDigest</code> has
+ * operations such as padding. Once {@code engineDigest} has
* been called, the engine should be reset (see
* {@link #engineReset() engineReset}).
* Resetting is the responsibility of the
@@ -194,7 +194,7 @@
* @return a clone if the implementation is cloneable.
*
* @exception CloneNotSupportedException if this is called on an
- * implementation that does not support <code>Cloneable</code>.
+ * implementation that does not support {@code Cloneable}.
*/
public Object clone() throws CloneNotSupportedException {
if (this instanceof Cloneable) {
diff --git a/ojluni/src/main/java/java/security/PolicySpi.java b/ojluni/src/main/java/java/security/PolicySpi.java
index aa66ba8..608ce1f 100644
--- a/ojluni/src/main/java/java/security/PolicySpi.java
+++ b/ojluni/src/main/java/java/security/PolicySpi.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,15 +28,15 @@
/**
* This class defines the <i>Service Provider Interface</i> (<b>SPI</b>)
- * for the <code>Policy</code> class.
+ * for the {@code Policy} class.
* All the abstract methods in this class must be implemented by each
* service provider who wishes to supply a Policy implementation.
*
* <p> Subclass implementations of this abstract class must provide
- * a public constructor that takes a <code>Policy.Parameters</code>
+ * a public constructor that takes a {@code Policy.Parameters}
* object as an input parameter. This constructor also must throw
* an IllegalArgumentException if it does not understand the
- * <code>Policy.Parameters</code> input.
+ * {@code Policy.Parameters} input.
*
*
* @since 1.6
@@ -59,7 +59,7 @@
/**
* Refreshes/reloads the policy configuration. The behavior of this method
- * depends on the implementation. For example, calling <code>refresh</code>
+ * depends on the implementation. For example, calling {@code refresh}
* on a file-based policy will cause the file to be re-read.
*
* <p> The default implementation of this method does nothing.
diff --git a/ojluni/src/main/java/java/security/ProviderException.java b/ojluni/src/main/java/java/security/ProviderException.java
index 449c8c3..b372ee7 100644
--- a/ojluni/src/main/java/java/security/ProviderException.java
+++ b/ojluni/src/main/java/java/security/ProviderException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -58,13 +58,13 @@
}
/**
- * Creates a <code>ProviderException</code> with the specified
+ * Creates a {@code ProviderException} with the specified
* detail message and cause.
*
* @param message the detail message (which is saved for later retrieval
* by the {@link #getMessage()} method).
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
@@ -73,13 +73,13 @@
}
/**
- * Creates a <code>ProviderException</code> with the specified cause
- * and a detail message of <tt>(cause==null ? null : cause.toString())</tt>
+ * Creates a {@code ProviderException} with the specified cause
+ * and a detail message of {@code (cause==null ? null : cause.toString())}
* (which typically contains the class and detail message of
- * <tt>cause</tt>).
+ * {@code cause}).
*
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
diff --git a/ojluni/src/main/java/java/security/PublicKey.java b/ojluni/src/main/java/java/security/PublicKey.java
index c983ff6..df49807 100644
--- a/ojluni/src/main/java/java/security/PublicKey.java
+++ b/ojluni/src/main/java/java/security/PublicKey.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@
*
* Note: The specialized public key interfaces extend this interface.
* See, for example, the DSAPublicKey interface in
- * <code>java.security.interfaces</code>.
+ * {@code java.security.interfaces}.
*
* @see Key
* @see PrivateKey
diff --git a/ojluni/src/main/java/java/security/SecureClassLoader.java b/ojluni/src/main/java/java/security/SecureClassLoader.java
index ffcd1a7..145f4fc 100644
--- a/ojluni/src/main/java/java/security/SecureClassLoader.java
+++ b/ojluni/src/main/java/java/security/SecureClassLoader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -63,12 +63,12 @@
* class loader for delegation.
*
* <p>If there is a security manager, this method first
- * calls the security manager's <code>checkCreateClassLoader</code>
+ * calls the security manager's {@code checkCreateClassLoader}
* method to ensure creation of a class loader is allowed.
* <p>
* @param parent the parent ClassLoader
* @exception SecurityException if a security manager exists and its
- * <code>checkCreateClassLoader</code> method doesn't allow
+ * {@code checkCreateClassLoader} method doesn't allow
* creation of a class loader.
* @see SecurityManager#checkCreateClassLoader
*/
@@ -87,11 +87,11 @@
* loader for delegation.
*
* <p>If there is a security manager, this method first
- * calls the security manager's <code>checkCreateClassLoader</code>
+ * calls the security manager's {@code checkCreateClassLoader}
* method to ensure creation of a class loader is allowed.
*
* @exception SecurityException if a security manager exists and its
- * <code>checkCreateClassLoader</code> method doesn't allow
+ * {@code checkCreateClassLoader} method doesn't allow
* creation of a class loader.
* @see SecurityManager#checkCreateClassLoader
*/
@@ -113,22 +113,22 @@
* If a non-null CodeSource is supplied a ProtectionDomain is
* constructed and associated with the class being defined.
* <p>
- * @param name the expected name of the class, or <code>null</code>
+ * @param name the expected name of the class, or {@code null}
* if not known, using '.' and not '/' as the separator
* and without a trailing ".class" suffix.
* @param b the bytes that make up the class data. The bytes in
- * positions <code>off</code> through <code>off+len-1</code>
+ * positions {@code off} through {@code off+len-1}
* should have the format of a valid class file as defined by
* <cite>The Java™ Virtual Machine Specification</cite>.
- * @param off the start offset in <code>b</code> of the class data
+ * @param off the start offset in {@code b} of the class data
* @param len the length of the class data
- * @param cs the associated CodeSource, or <code>null</code> if none
- * @return the <code>Class</code> object created from the data,
+ * @param cs the associated CodeSource, or {@code null} if none
+ * @return the {@code Class} object created from the data,
* and optional CodeSource.
* @exception ClassFormatError if the data did not contain a valid class
- * @exception IndexOutOfBoundsException if either <code>off</code> or
- * <code>len</code> is negative, or if
- * <code>off+len</code> is greater than <code>b.length</code>.
+ * @exception IndexOutOfBoundsException if either {@code off} or
+ * {@code len} is negative, or if
+ * {@code off+len} is greater than {@code b.length}.
*
* @exception SecurityException if an attempt is made to add this class
* to a package that contains classes that were signed by
@@ -143,22 +143,22 @@
}
/**
- * Converts a {@link java.nio.ByteBuffer <tt>ByteBuffer</tt>}
- * into an instance of class <tt>Class</tt>, with an optional CodeSource.
+ * Converts a {@link java.nio.ByteBuffer ByteBuffer}
+ * into an instance of class {@code Class}, with an optional CodeSource.
* Before the class can be used it must be resolved.
* <p>
* If a non-null CodeSource is supplied a ProtectionDomain is
* constructed and associated with the class being defined.
* <p>
- * @param name the expected name of the class, or <code>null</code>
+ * @param name the expected name of the class, or {@code null}
* if not known, using '.' and not '/' as the separator
* and without a trailing ".class" suffix.
* @param b the bytes that make up the class data. The bytes from positions
- * <tt>b.position()</tt> through <tt>b.position() + b.limit() -1</tt>
+ * {@code b.position()} through {@code b.position() + b.limit() -1}
* should have the format of a valid class file as defined by
* <cite>The Java™ Virtual Machine Specification</cite>.
- * @param cs the associated CodeSource, or <code>null</code> if none
- * @return the <code>Class</code> object created from the data,
+ * @param cs the associated CodeSource, or {@code null} if none
+ * @return the {@code Class} object created from the data,
* and optional CodeSource.
* @exception ClassFormatError if the data did not contain a valid class
* @exception SecurityException if an attempt is made to add this class
diff --git a/ojluni/src/main/java/java/security/SecureRandomSpi.java b/ojluni/src/main/java/java/security/SecureRandomSpi.java
index 12652e9..ef6c243 100644
--- a/ojluni/src/main/java/java/security/SecureRandomSpi.java
+++ b/ojluni/src/main/java/java/security/SecureRandomSpi.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
/**
* This class defines the <i>Service Provider Interface</i> (<b>SPI</b>)
- * for the <code>SecureRandom</code> class.
+ * for the {@code SecureRandom} class.
* All the abstract methods in this class must be implemented by each
* service provider who wishes to supply the implementation
* of a cryptographically strong pseudo-random number generator.
@@ -53,10 +53,10 @@
/**
* Generates a user-specified number of random bytes.
*
- * <p> If a call to <code>engineSetSeed</code> had not occurred previously,
+ * <p> If a call to {@code engineSetSeed} had not occurred previously,
* the first call to this method forces this SecureRandom implementation
* to seed itself. This self-seeding will not occur if
- * <code>engineSetSeed</code> was previously called.
+ * {@code engineSetSeed} was previously called.
*
* @param bytes the array to be filled in with random bytes.
*/
diff --git a/ojluni/src/main/java/java/security/Security.java b/ojluni/src/main/java/java/security/Security.java
index 003fb81..99d5526 100644
--- a/ojluni/src/main/java/java/security/Security.java
+++ b/ojluni/src/main/java/java/security/Security.java
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2014 The Android Open Source Project
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,6 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import java.io.*;
-
import sun.security.jca.GetInstance;
import sun.security.jca.ProviderList;
import sun.security.jca.Providers;
@@ -40,6 +39,10 @@
* <p>This class centralizes all security properties and common security
* methods. One of its primary uses is to manage providers.
*
+ * <p>The default values of security properties are read from an
+ * implementation-specific location, which is typically the properties file
+ * {@code lib/security/java.security} in the Java installation directory.
+ *
* @author Benjamin Renaud
*/
@@ -186,7 +189,7 @@
* property in the master file of the "SUN" Cryptographic Service
* Provider in order to determine how to parse algorithm-specific
* parameters. Use the new provider-based and algorithm-independent
- * <code>AlgorithmParameters</code> and <code>KeyFactory</code> engine
+ * {@code AlgorithmParameters} and {@code KeyFactory} engine
* classes (introduced in the J2SE version 1.2 platform) instead.
*/
@Deprecated
@@ -209,22 +212,18 @@
*
* <p>If the given provider is installed at the requested position,
* the provider that used to be at that position, and all providers
- * with a position greater than <code>position</code>, are shifted up
+ * with a position greater than {@code position}, are shifted up
* one position (towards the end of the list of installed providers).
*
* <p>A provider cannot be added if it is already installed.
*
- * <p>First, if there is a security manager, its
- * <code>checkSecurityAccess</code>
- * method is called with the string
- * <code>"insertProvider."+provider.getName()</code>
- * to see if it's ok to add a new provider.
- * If the default implementation of <code>checkSecurityAccess</code>
- * is used (i.e., that method is not overriden), then this will result in
- * a call to the security manager's <code>checkPermission</code> method
- * with a
- * <code>SecurityPermission("insertProvider."+provider.getName())</code>
- * permission.
+ * <p>If there is a security manager, the
+ * {@link java.lang.SecurityManager#checkSecurityAccess} method is called
+ * with the {@code "insertProvider"} permission target name to see if
+ * it's ok to add a new provider. If this permission check is denied,
+ * {@code checkSecurityAccess} is called again with the
+ * {@code "insertProvider."+provider.getName()} permission target name. If
+ * both checks are denied, a {@code SecurityException} is thrown.
*
* @param provider the provider to be added.
*
@@ -237,8 +236,8 @@
*
* @throws NullPointerException if provider is null
* @throws SecurityException
- * if a security manager exists and its <code>{@link
- * java.lang.SecurityManager#checkSecurityAccess}</code> method
+ * if a security manager exists and its {@link
+ * java.lang.SecurityManager#checkSecurityAccess} method
* denies access to add a new provider
*
* @see #getProvider
@@ -248,7 +247,10 @@
public static synchronized int insertProviderAt(Provider provider,
int position) {
String providerName = provider.getName();
- check("insertProvider." + providerName);
+ // ANDROID-REMOVED
+ // Checks using SecurityManager, which is not functional in Android.
+ // checkInsertProvider(providerName);
+ // ANDROID-REMOVED
ProviderList list = Providers.getFullProviderList();
ProviderList newList = ProviderList.insertAt(list, provider, position - 1);
if (list == newList) {
@@ -262,17 +264,13 @@
/**
* Adds a provider to the next position available.
*
- * <p>First, if there is a security manager, its
- * <code>checkSecurityAccess</code>
- * method is called with the string
- * <code>"insertProvider."+provider.getName()</code>
- * to see if it's ok to add a new provider.
- * If the default implementation of <code>checkSecurityAccess</code>
- * is used (i.e., that method is not overriden), then this will result in
- * a call to the security manager's <code>checkPermission</code> method
- * with a
- * <code>SecurityPermission("insertProvider."+provider.getName())</code>
- * permission.
+ * <p>If there is a security manager, the
+ * {@link java.lang.SecurityManager#checkSecurityAccess} method is called
+ * with the {@code "insertProvider"} permission target name to see if
+ * it's ok to add a new provider. If this permission check is denied,
+ * {@code checkSecurityAccess} is called again with the
+ * {@code "insertProvider."+provider.getName()} permission target name. If
+ * both checks are denied, a {@code SecurityException} is thrown.
*
* @param provider the provider to be added.
*
@@ -282,8 +280,8 @@
*
* @throws NullPointerException if provider is null
* @throws SecurityException
- * if a security manager exists and its <code>{@link
- * java.lang.SecurityManager#checkSecurityAccess}</code> method
+ * if a security manager exists and its {@link
+ * java.lang.SecurityManager#checkSecurityAccess} method
* denies access to add a new provider
*
* @see #getProvider
@@ -312,20 +310,20 @@
* if name is null.
*
* <p>First, if there is a security manager, its
- * <code>checkSecurityAccess</code>
- * method is called with the string <code>"removeProvider."+name</code>
+ * {@code checkSecurityAccess}
+ * method is called with the string {@code "removeProvider."+name}
* to see if it's ok to remove the provider.
- * If the default implementation of <code>checkSecurityAccess</code>
+ * If the default implementation of {@code checkSecurityAccess}
* is used (i.e., that method is not overriden), then this will result in
- * a call to the security manager's <code>checkPermission</code> method
- * with a <code>SecurityPermission("removeProvider."+name)</code>
+ * a call to the security manager's {@code checkPermission} method
+ * with a {@code SecurityPermission("removeProvider."+name)}
* permission.
*
* @param name the name of the provider to remove.
*
* @throws SecurityException
- * if a security manager exists and its <code>{@link
- * java.lang.SecurityManager#checkSecurityAccess}</code> method
+ * if a security manager exists and its {@link
+ * java.lang.SecurityManager#checkSecurityAccess} method
* denies
* access to remove the provider
*
@@ -370,8 +368,8 @@
* Returns an array containing all installed providers that satisfy the
* specified selection criterion, or null if no such providers have been
* installed. The returned providers are ordered
- * according to their <a href=
- * "#insertProviderAt(java.security.Provider, int)">preference order</a>.
+ * according to their
+ * {@linkplain #insertProviderAt(java.security.Provider, int) preference order}.
*
* <p> A cryptographic service is always associated with a particular
* algorithm or type. For example, a digital signature service is
@@ -382,8 +380,8 @@
* <p>The selection criterion must be specified in one of the following two
* formats:
* <ul>
- * <li> <i><crypto_service>.<algorithm_or_type></i> <p> The
- * cryptographic service name must not contain any dots.
+ * <li> <i>{@literal <crypto_service>.<algorithm_or_type>}</i>
+ * <p> The cryptographic service name must not contain any dots.
* <p> A
* provider satisfies the specified selection criterion iff the provider
* implements the
@@ -391,11 +389,12 @@
* <p> For example, "CertificateFactory.X.509"
* would be satisfied by any provider that supplied
* a CertificateFactory implementation for X.509 certificates.
- * <li> <i><crypto_service>.<algorithm_or_type>
- * <attribute_name>:< attribute_value></i>
+ * <li> <i>{@literal <crypto_service>.<algorithm_or_type>
+ * <attribute_name>:<attribute_value>}</i>
* <p> The cryptographic service name must not contain any dots. There
- * must be one or more space charaters between the
- * <i><algorithm_or_type></i> and the <i><attribute_name></i>.
+ * must be one or more space characters between the
+ * <i>{@literal <algorithm_or_type>}</i> and the
+ * <i>{@literal <attribute_name>}</i>.
* <p> A provider satisfies this selection criterion iff the
* provider implements the specified algorithm or type for the specified
* cryptographic service and its implementation meets the
@@ -448,8 +447,9 @@
* Returns an array containing all installed providers that satisfy the
* specified* selection criteria, or null if no such providers have been
* installed. The returned providers are ordered
- * according to their <a href=
- * "#insertProviderAt(java.security.Provider, int)">preference order</a>.
+ * according to their
+ * {@linkplain #insertProviderAt(java.security.Provider, int)
+ * preference order}.
*
* <p>The selection criteria are represented by a map.
* Each map entry represents a selection criterion.
@@ -457,16 +457,18 @@
* criteria. The key for any entry in such a map must be in one of the
* following two formats:
* <ul>
- * <li> <i><crypto_service>.<algorithm_or_type></i>
+ * <li> <i>{@literal <crypto_service>.<algorithm_or_type>}</i>
* <p> The cryptographic service name must not contain any dots.
* <p> The value associated with the key must be an empty string.
* <p> A provider
* satisfies this selection criterion iff the provider implements the
* specified algorithm or type for the specified cryptographic service.
- * <li> <i><crypto_service>.<algorithm_or_type> <attribute_name></i>
+ * <li> <i>{@literal <crypto_service>}.
+ * {@literal <algorithm_or_type> <attribute_name>}</i>
* <p> The cryptographic service name must not contain any dots. There
- * must be one or more space charaters between the <i><algorithm_or_type></i>
- * and the <i><attribute_name></i>.
+ * must be one or more space characters between the
+ * <i>{@literal <algorithm_or_type>}</i>
+ * and the <i>{@literal <attribute_name>}</i>.
* <p> The value associated with the key must be a non-empty string.
* A provider satisfies this selection criterion iff the
* provider implements the specified algorithm or type for the specified
@@ -552,15 +554,16 @@
}
// Map containing cached Spi Class objects of the specified type
- private static final Map<String, Class> spiMap = new ConcurrentHashMap<>();
+ private static final Map<String, Class<?>> spiMap =
+ new ConcurrentHashMap<>();
/**
* Return the Class object for the given engine type
* (e.g. "MessageDigest"). Works for Spis in the java.security package
* only.
*/
- private static Class getSpiClass(String type) {
- Class clazz = spiMap.get(type);
+ private static Class<?> getSpiClass(String type) {
+ Class<?> clazz = spiMap.get(type);
if (clazz != null) {
return clazz;
}
@@ -578,7 +581,7 @@
* an instance of an implementation of the requested algorithm
* and type, and the second object in the array identifies the provider
* of that implementation.
- * The <code>provider</code> argument can be null, in which case all
+ * The {@code provider} argument can be null, in which case all
* configured providers will be searched in order of preference.
*/
static Object[] getImpl(String algorithm, String type, String provider)
@@ -609,7 +612,7 @@
* an instance of an implementation of the requested algorithm
* and type, and the second object in the array identifies the provider
* of that implementation.
- * The <code>provider</code> argument cannot be null.
+ * The {@code provider} argument cannot be null.
*/
static Object[] getImpl(String algorithm, String type, Provider provider)
throws NoSuchAlgorithmException {
@@ -628,8 +631,8 @@
* Gets a security property value.
*
* <p>First, if there is a security manager, its
- * <code>checkPermission</code> method is called with a
- * <code>java.security.SecurityPermission("getProperty."+key)</code>
+ * {@code checkPermission} method is called with a
+ * {@code java.security.SecurityPermission("getProperty."+key)}
* permission to see if it's ok to retrieve the specified
* security property value..
*
@@ -638,8 +641,8 @@
* @return the value of the security property corresponding to key.
*
* @throws SecurityException
- * if a security manager exists and its <code>{@link
- * java.lang.SecurityManager#checkPermission}</code> method
+ * if a security manager exists and its {@link
+ * java.lang.SecurityManager#checkPermission} method
* denies
* access to retrieve the specified security property value
* @throws NullPointerException is key is null
@@ -663,8 +666,8 @@
* Sets a security property value.
*
* <p>First, if there is a security manager, its
- * <code>checkPermission</code> method is called with a
- * <code>java.security.SecurityPermission("setProperty."+key)</code>
+ * {@code checkPermission} method is called with a
+ * {@code java.security.SecurityPermission("setProperty."+key)}
* permission to see if it's ok to set the specified
* security property value.
*
@@ -673,8 +676,8 @@
* @param datum the value of the property to be set.
*
* @throws SecurityException
- * if a security manager exists and its <code>{@link
- * java.lang.SecurityManager#checkPermission}</code> method
+ * if a security manager exists and its {@link
+ * java.lang.SecurityManager#checkPermission} method
* denies access to set the specified security property value
* @throws NullPointerException if key or datum is null
*
@@ -708,7 +711,7 @@
public Void run() {
try {
/* Get the class via the bootstrap class loader. */
- Class cl = Class.forName(
+ Class<?> cl = Class.forName(
"java.lang.SecurityManager", false, null);
Field f = null;
boolean accessible = false;
@@ -971,7 +974,7 @@
if ((serviceName == null) || (serviceName.length() == 0) ||
(serviceName.endsWith("."))) {
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
HashSet<String> result = new HashSet<>();
@@ -981,8 +984,10 @@
// Check the keys for each provider.
for (Enumeration<Object> e = providers[i].keys();
e.hasMoreElements(); ) {
- String currentKey = ((String)e.nextElement()).toUpperCase();
- if (currentKey.startsWith(serviceName.toUpperCase())) {
+ String currentKey =
+ ((String)e.nextElement()).toUpperCase(Locale.ENGLISH);
+ if (currentKey.startsWith(
+ serviceName.toUpperCase(Locale.ENGLISH))) {
// We should skip the currentKey if it contains a
// whitespace. The reason is: such an entry in the
// provider property contains attributes for the
@@ -990,7 +995,8 @@
// in entries which lead to the implementation
// classes.
if (currentKey.indexOf(" ") < 0) {
- result.add(currentKey.substring(serviceName.length() + 1));
+ result.add(currentKey.substring(
+ serviceName.length() + 1));
}
}
}
diff --git a/ojluni/src/main/java/java/security/SignatureException.java b/ojluni/src/main/java/java/security/SignatureException.java
index c47de31..2e1fa59 100644
--- a/ojluni/src/main/java/java/security/SignatureException.java
+++ b/ojluni/src/main/java/java/security/SignatureException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -56,13 +56,13 @@
}
/**
- * Creates a <code>SignatureException</code> with the specified
+ * Creates a {@code SignatureException} with the specified
* detail message and cause.
*
* @param message the detail message (which is saved for later retrieval
* by the {@link #getMessage()} method).
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
@@ -71,13 +71,13 @@
}
/**
- * Creates a <code>SignatureException</code> with the specified cause
- * and a detail message of <tt>(cause==null ? null : cause.toString())</tt>
+ * Creates a {@code SignatureException} with the specified cause
+ * and a detail message of {@code (cause==null ? null : cause.toString())}
* (which typically contains the class and detail message of
- * <tt>cause</tt>).
+ * {@code cause}).
*
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
diff --git a/ojluni/src/main/java/java/security/SignatureSpi.java b/ojluni/src/main/java/java/security/SignatureSpi.java
index d18b361..8a10af9 100644
--- a/ojluni/src/main/java/java/security/SignatureSpi.java
+++ b/ojluni/src/main/java/java/security/SignatureSpi.java
@@ -36,7 +36,7 @@
/**
* This class defines the <i>Service Provider Interface</i> (<b>SPI</b>)
- * for the <code>Signature</code> class, which is used to provide the
+ * for the {@code Signature} class, which is used to provide the
* functionality of a digital signature algorithm. Digital signatures are used
* for authentication and integrity assurance of digital data.
*.
@@ -131,8 +131,8 @@
/**
* Updates the data to be signed or verified using the specified
- * ByteBuffer. Processes the <code>data.remaining()</code> bytes
- * starting at at <code>data.position()</code>.
+ * ByteBuffer. Processes the {@code data.remaining()} bytes
+ * starting at at {@code data.position()}.
* Upon return, the buffer's position will be equal to its limit;
* its limit will not have changed.
*
@@ -184,14 +184,14 @@
/**
* Finishes this signature operation and stores the resulting signature
- * bytes in the provided buffer <code>outbuf</code>, starting at
- * <code>offset</code>.
+ * bytes in the provided buffer {@code outbuf}, starting at
+ * {@code offset}.
* The format of the signature depends on the underlying
* signature scheme.
*
* <p>The signature implementation is reset to its initial state
* (the state it was in after a call to one of the
- * <code>engineInitSign</code> methods)
+ * {@code engineInitSign} methods)
* and can be reused to generate further signatures with the same private
* key.
*
@@ -201,10 +201,10 @@
*
* @param outbuf buffer for the signature result.
*
- * @param offset offset into <code>outbuf</code> where the signature is
+ * @param offset offset into {@code outbuf} where the signature is
* stored.
*
- * @param len number of bytes within <code>outbuf</code> allotted for the
+ * @param len number of bytes within {@code outbuf} allotted for the
* signature.
* Both this default implementation and the SUN provider do not
* return partial digests. If the value of this parameter is less
@@ -213,11 +213,11 @@
* This parameter is ignored if its value is greater than or equal to
* the actual signature length.
*
- * @return the number of bytes placed into <code>outbuf</code>
+ * @return the number of bytes placed into {@code outbuf}
*
* @exception SignatureException if the engine is not
* initialized properly, if this signature algorithm is unable to
- * process the input data provided, or if <code>len</code> is less
+ * process the input data provided, or if {@code len} is less
* than the actual signature length.
*
* @since 1.2
@@ -294,7 +294,7 @@
*
* @param value the parameter value.
*
- * @exception InvalidParameterException if <code>param</code> is an
+ * @exception InvalidParameterException if {@code param} is an
* invalid parameter for this signature algorithm engine,
* the parameter is already set
* and cannot be set again, a security exception occurs, and so on.
@@ -363,7 +363,7 @@
* @return the object that represents the parameter value, or null if
* there is none.
*
- * @exception InvalidParameterException if <code>param</code> is an
+ * @exception InvalidParameterException if {@code param} is an
* invalid parameter for this engine, or another exception occurs while
* trying to get this parameter.
*
@@ -380,7 +380,7 @@
* @return a clone if the implementation is cloneable.
*
* @exception CloneNotSupportedException if this is called
- * on an implementation that does not support <code>Cloneable</code>.
+ * on an implementation that does not support {@code Cloneable}.
*/
public Object clone() throws CloneNotSupportedException {
if (this instanceof Cloneable) {
diff --git a/ojluni/src/main/java/java/security/SignedObject.java b/ojluni/src/main/java/java/security/SignedObject.java
index 1f901fa..9ac864e 100644
--- a/ojluni/src/main/java/java/security/SignedObject.java
+++ b/ojluni/src/main/java/java/security/SignedObject.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -40,44 +40,44 @@
* the original object has no side effect on the copy.
*
* <p> The underlying signing algorithm is designated by the Signature
- * object passed to the constructor and the <code>verify</code> method.
+ * object passed to the constructor and the {@code verify} method.
* A typical usage for signing is the following:
*
- * <p> <code> <pre>
+ * <pre>{@code
* Signature signingEngine = Signature.getInstance(algorithm,
* provider);
* SignedObject so = new SignedObject(myobject, signingKey,
* signingEngine);
- * </pre> </code>
+ * }</pre>
*
* <p> A typical usage for verification is the following (having
- * received SignedObject <code>so</code>):
+ * received SignedObject {@code so}):
*
- * <p> <code> <pre>
+ * <pre>{@code
* Signature verificationEngine =
* Signature.getInstance(algorithm, provider);
* if (so.verify(publickey, verificationEngine))
* try {
* Object myobj = so.getObject();
* } catch (java.lang.ClassNotFoundException e) {};
- * </pre> </code>
+ * }</pre>
*
* <p> Several points are worth noting. First, there is no need to
* initialize the signing or verification engine, as it will be
- * re-initialized inside the constructor and the <code>verify</code>
+ * re-initialized inside the constructor and the {@code verify}
* method. Secondly, for verification to succeed, the specified
* public key must be the public key corresponding to the private key
* used to generate the SignedObject.
*
* <p> More importantly, for flexibility reasons, the
- * constructor and <code>verify</code> method allow for
+ * constructor and {@code verify} method allow for
* customized signature engines, which can implement signature
* algorithms that are not installed formally as part of a crypto
* provider. However, it is crucial that the programmer writing the
- * verifier code be aware what <code>Signature</code> engine is being
- * used, as its own implementation of the <code>verify</code> method
+ * verifier code be aware what {@code Signature} engine is being
+ * used, as its own implementation of the {@code verify} method
* is invoked to verify a signature. In other words, a malicious
- * <code>Signature</code> may choose to always return true on
+ * {@code Signature} may choose to always return true on
* verification in an attempt to bypass a security check.
*
* <p> The signature algorithm can be, among others, the NIST standard
@@ -92,7 +92,7 @@
*
* <p> The name of the Cryptography Package Provider is designated
* also by the Signature parameter to the constructor and the
- * <code>verify</code> method. If the provider is not
+ * {@code verify} method. If the provider is not
* specified, the default provider is used. Each installation can
* be configured to use a particular provider as default.
*
@@ -214,8 +214,8 @@
* @exception SignatureException if signature verification failed.
* @exception InvalidKeyException if the verification key is invalid.
*
- * @return <tt>true</tt> if the signature
- * is valid, <tt>false</tt> otherwise
+ * @return {@code true} if the signature
+ * is valid, {@code false} otherwise
*/
public boolean verify(PublicKey verificationKey,
Signature verificationEngine)
diff --git a/ojluni/src/main/java/java/security/Signer.java b/ojluni/src/main/java/java/security/Signer.java
index 9224780..077538d 100644
--- a/ojluni/src/main/java/java/security/Signer.java
+++ b/ojluni/src/main/java/java/security/Signer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -40,9 +40,9 @@
* @author Benjamin Renaud
*
* @deprecated This class is no longer used. Its functionality has been
- * replaced by <code>java.security.KeyStore</code>, the
- * <code>java.security.cert</code> package, and
- * <code>java.security.Principal</code>.
+ * replaced by {@code java.security.KeyStore}, the
+ * {@code java.security.cert} package, and
+ * {@code java.security.Principal}.
*/
@Deprecated
public abstract class Signer extends Identity {
@@ -92,15 +92,15 @@
/**
* Returns this signer's private key.
*
- * <p>First, if there is a security manager, its <code>checkSecurityAccess</code>
- * method is called with <code>"getSignerPrivateKey"</code>
+ * <p>First, if there is a security manager, its {@code checkSecurityAccess}
+ * method is called with {@code "getSignerPrivateKey"}
* as its argument to see if it's ok to return the private key.
*
* @return this signer's private key, or null if the private key has
* not yet been set.
*
* @exception SecurityException if a security manager exists and its
- * <code>checkSecurityAccess</code> method doesn't allow
+ * {@code checkSecurityAccess} method doesn't allow
* returning the private key.
*
* @see SecurityManager#checkSecurityAccess
@@ -113,8 +113,8 @@
/**
* Sets the key pair (public key and private key) for this signer.
*
- * <p>First, if there is a security manager, its <code>checkSecurityAccess</code>
- * method is called with <code>"setSignerKeyPair"</code>
+ * <p>First, if there is a security manager, its {@code checkSecurityAccess}
+ * method is called with {@code "setSignerKeyPair"}
* as its argument to see if it's ok to set the key pair.
*
* @param pair an initialized key pair.
@@ -124,7 +124,7 @@
* @exception KeyException if the key pair cannot be set for any
* other reason.
* @exception SecurityException if a security manager exists and its
- * <code>checkSecurityAccess</code> method doesn't allow
+ * {@code checkSecurityAccess} method doesn't allow
* setting the key pair.
*
* @see SecurityManager#checkSecurityAccess
diff --git a/ojluni/src/main/java/java/security/UnresolvedPermissionCollection.java b/ojluni/src/main/java/java/security/UnresolvedPermissionCollection.java
index 69f6e60..7633648 100644
--- a/ojluni/src/main/java/java/security/UnresolvedPermissionCollection.java
+++ b/ojluni/src/main/java/java/security/UnresolvedPermissionCollection.java
@@ -197,8 +197,12 @@
ObjectInputStream.GetField gfields = in.readFields();
// Get permissions
+ @SuppressWarnings("unchecked")
+ // writeObject writes a Hashtable<String, Vector<UnresolvedPermission>>
+ // for the permissions key, so this cast is safe, unless the data is corrupt.
Hashtable<String, Vector<UnresolvedPermission>> permissions =
- (Hashtable<String, Vector<UnresolvedPermission>>)gfields.get("permissions", null);
+ (Hashtable<String, Vector<UnresolvedPermission>>)
+ gfields.get("permissions", null);
perms = new HashMap<String, List<UnresolvedPermission>>(permissions.size()*2);
// Convert each entry (Vector) into a List
diff --git a/ojluni/src/main/java/java/security/acl/Acl.java b/ojluni/src/main/java/java/security/acl/Acl.java
index e90f740..b9cf004 100644
--- a/ojluni/src/main/java/java/security/acl/Acl.java
+++ b/ojluni/src/main/java/java/security/acl/Acl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -42,43 +42,43 @@
* granted to the associated principal. If negative, the permissions
* are to be denied.<p>
*
- * The ACL Entries in each ACL observe the following rules:<p>
+ * The ACL Entries in each ACL observe the following rules:
*
* <ul> <li>Each principal can have at most one positive ACL entry and
* one negative entry; that is, multiple positive or negative ACL
* entries are not allowed for any principal. Each entry specifies
* the set of permissions that are to be granted (if positive) or
- * denied (if negative). <p>
+ * denied (if negative).
*
* <li>If there is no entry for a particular principal, then the
- * principal is considered to have a null (empty) permission set.<p>
+ * principal is considered to have a null (empty) permission set.
*
* <li>If there is a positive entry that grants a principal a
* particular permission, and a negative entry that denies the
* principal the same permission, the result is as though the
- * permission was never granted or denied. <p>
+ * permission was never granted or denied.
*
* <li>Individual permissions always override permissions of the
* group(s) to which the individual belongs. That is, individual
* negative permissions (specific denial of permissions) override the
* groups' positive permissions. And individual positive permissions
- * override the groups' negative permissions.<p>
+ * override the groups' negative permissions.
*
* </ul>
*
- * The <code> java.security.acl </code> package provides the
+ * The {@code java.security.acl } package provides the
* interfaces to the ACL and related data structures (ACL entries,
- * groups, permissions, etc.), and the <code> sun.security.acl </code>
+ * groups, permissions, etc.), and the {@code sun.security.acl }
* classes provide a default implementation of the interfaces. For
- * example, <code> java.security.acl.Acl </code> provides the
- * interface to an ACL and the <code> sun.security.acl.AclImpl </code>
+ * example, {@code java.security.acl.Acl } provides the
+ * interface to an ACL and the {@code sun.security.acl.AclImpl }
* class provides the default implementation of the interface.<p>
*
- * The <code> java.security.acl.Acl </code> interface extends the
- * <code> java.security.acl.Owner </code> interface. The Owner
+ * The {@code java.security.acl.Acl } interface extends the
+ * {@code java.security.acl.Owner } interface. The Owner
* interface is used to maintain a list of owners for each ACL. Only
* owners are allowed to modify an ACL. For example, only an owner can
- * call the ACL's <code>addEntry</code> method to add a new ACL entry
+ * call the ACL's {@code addEntry} method to add a new ACL entry
* to the ACL.
*
* @see java.security.acl.AclEntry
@@ -159,12 +159,12 @@
* Returns an enumeration for the set of allowed permissions for the
* specified principal (representing an entity such as an individual or
* a group). This set of allowed permissions is calculated as
- * follows:<p>
+ * follows:
*
* <ul>
*
* <li>If there is no entry in this Access Control List for the
- * specified principal, an empty permission set is returned.<p>
+ * specified principal, an empty permission set is returned.
*
* <li>Otherwise, the principal's group permission sets are determined.
* (A principal can belong to one or more groups, where a group is a
@@ -217,7 +217,7 @@
* More specifically, this method checks whether the passed permission
* is a member of the allowed permission set of the specified principal.
* The allowed permission set is determined by the same algorithm as is
- * used by the <code>getPermissions</code> method.
+ * used by the {@code getPermissions} method.
*
* @param principal the principal, assumed to be a valid authenticated
* Principal.
diff --git a/ojluni/src/main/java/java/security/acl/AclEntry.java b/ojluni/src/main/java/java/security/acl/AclEntry.java
index f8dd3a7..cd9675f 100644
--- a/ojluni/src/main/java/java/security/acl/AclEntry.java
+++ b/ojluni/src/main/java/java/security/acl/AclEntry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -84,7 +84,7 @@
* specified in the entry.
*
* Note: ACL entries are by default positive. An entry becomes a
- * negative entry only if this <code>setNegativePermissions</code>
+ * negative entry only if this {@code setNegativePermissions}
* method is called on it.
*/
public void setNegativePermissions();
diff --git a/ojluni/src/main/java/java/security/acl/Group.java b/ojluni/src/main/java/java/security/acl/Group.java
index be3578b..ebd9c44 100644
--- a/ojluni/src/main/java/java/security/acl/Group.java
+++ b/ojluni/src/main/java/java/security/acl/Group.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@
* Note that Group extends Principal. Thus, either a Principal or a Group can
* be passed as an argument to methods containing a Principal parameter. For
* example, you can add either a Principal or a Group to a Group object by
- * calling the object's <code>addMember</code> method, passing it the
+ * calling the object's {@code addMember} method, passing it the
* Principal or Group.
*
* @author Satish Dharmaraj
diff --git a/ojluni/src/main/java/java/security/acl/Owner.java b/ojluni/src/main/java/java/security/acl/Owner.java
index 3138895..2f649d4 100644
--- a/ojluni/src/main/java/java/security/acl/Owner.java
+++ b/ojluni/src/main/java/java/security/acl/Owner.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1997, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
/**
* Interface for managing owners of Access Control Lists (ACLs) or ACL
* configurations. (Note that the Acl interface in the
- * <code> java.security.acl </code> package extends this Owner
+ * {@code java.security.acl} package extends this Owner
* interface.) The initial owner Principal should be specified as an
* argument to the constructor of the class implementing this interface.
*
diff --git a/ojluni/src/main/java/java/security/acl/package-info.java b/ojluni/src/main/java/java/security/acl/package-info.java
new file mode 100644
index 0000000..356c102
--- /dev/null
+++ b/ojluni/src/main/java/java/security/acl/package-info.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * The classes and interfaces in this package have been
+ * superseded by classes in the java.security package.
+ * See that package and, for example, java.security.Permission for details.
+ *
+ * @since JDK1.1
+ */
+package java.security.acl;
diff --git a/ojluni/src/main/java/java/security/acl/package.html b/ojluni/src/main/java/java/security/acl/package.html
deleted file mode 100755
index 497dfe8..0000000
--- a/ojluni/src/main/java/java/security/acl/package.html
+++ /dev/null
@@ -1,54 +0,0 @@
-<DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation. Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-</head>
-<body bgcolor="white">
-
-The classes and interfaces in this package have been
-superseded by classes in the java.security package.
-See that package and, for example, java.security.Permission for details.
-
-<!--
-<h2>Package Specification</h2>
-
-##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
-<ul>
- <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
- <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
-</ul>
--->
-
-@since JDK1.1
-</body>
-</html>
diff --git a/ojluni/src/main/java/java/security/cert/CRLException.java b/ojluni/src/main/java/java/security/cert/CRLException.java
index ca5b689..7a85431 100644
--- a/ojluni/src/main/java/java/security/cert/CRLException.java
+++ b/ojluni/src/main/java/java/security/cert/CRLException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -57,13 +57,13 @@
}
/**
- * Creates a <code>CRLException</code> with the specified
+ * Creates a {@code CRLException} with the specified
* detail message and cause.
*
* @param message the detail message (which is saved for later retrieval
* by the {@link #getMessage()} method).
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
@@ -72,13 +72,13 @@
}
/**
- * Creates a <code>CRLException</code> with the specified cause
- * and a detail message of <tt>(cause==null ? null : cause.toString())</tt>
+ * Creates a {@code CRLException} with the specified cause
+ * and a detail message of {@code (cause==null ? null : cause.toString())}
* (which typically contains the class and detail message of
- * <tt>cause</tt>).
+ * {@code cause}).
*
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
diff --git a/ojluni/src/main/java/java/security/cert/CRLSelector.java b/ojluni/src/main/java/java/security/cert/CRLSelector.java
index 2c00f10..7ab181d 100644
--- a/ojluni/src/main/java/java/security/cert/CRLSelector.java
+++ b/ojluni/src/main/java/java/security/cert/CRLSelector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,9 +26,9 @@
package java.security.cert;
/**
- * A selector that defines a set of criteria for selecting <code>CRL</code>s.
+ * A selector that defines a set of criteria for selecting {@code CRL}s.
* Classes that implement this interface are often used to specify
- * which <code>CRL</code>s should be retrieved from a <code>CertStore</code>.
+ * which {@code CRL}s should be retrieved from a {@code CertStore}.
* <p>
* <b>Concurrent Access</b>
* <p>
@@ -48,19 +48,19 @@
public interface CRLSelector extends Cloneable {
/**
- * Decides whether a <code>CRL</code> should be selected.
+ * Decides whether a {@code CRL} should be selected.
*
- * @param crl the <code>CRL</code> to be checked
- * @return <code>true</code> if the <code>CRL</code> should be selected,
- * <code>false</code> otherwise
+ * @param crl the {@code CRL} to be checked
+ * @return {@code true} if the {@code CRL} should be selected,
+ * {@code false} otherwise
*/
boolean match(CRL crl);
/**
- * Makes a copy of this <code>CRLSelector</code>. Changes to the
+ * Makes a copy of this {@code CRLSelector}. Changes to the
* copy will not affect the original and vice versa.
*
- * @return a copy of this <code>CRLSelector</code>
+ * @return a copy of this {@code CRLSelector}
*/
Object clone();
}
diff --git a/ojluni/src/main/java/java/security/cert/CertPath.java b/ojluni/src/main/java/java/security/cert/CertPath.java
index 600000a..f742664 100644
--- a/ojluni/src/main/java/java/security/cert/CertPath.java
+++ b/ojluni/src/main/java/java/security/cert/CertPath.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -36,59 +36,59 @@
* An immutable sequence of certificates (a certification path).
* <p>
* This is an abstract class that defines the methods common to all
- * <code>CertPath</code>s. Subclasses can handle different kinds of
+ * {@code CertPath}s. Subclasses can handle different kinds of
* certificates (X.509, PGP, etc.).
* <p>
- * All <code>CertPath</code> objects have a type, a list of
- * <code>Certificate</code>s, and one or more supported encodings. Because the
- * <code>CertPath</code> class is immutable, a <code>CertPath</code> cannot
+ * All {@code CertPath} objects have a type, a list of
+ * {@code Certificate}s, and one or more supported encodings. Because the
+ * {@code CertPath} class is immutable, a {@code CertPath} cannot
* change in any externally visible way after being constructed. This
* stipulation applies to all public fields and methods of this class and any
* added or overridden by subclasses.
* <p>
- * The type is a <code>String</code> that identifies the type of
- * <code>Certificate</code>s in the certification path. For each
- * certificate <code>cert</code> in a certification path <code>certPath</code>,
- * <code>cert.getType().equals(certPath.getType())</code> must be
- * <code>true</code>.
+ * The type is a {@code String} that identifies the type of
+ * {@code Certificate}s in the certification path. For each
+ * certificate {@code cert} in a certification path {@code certPath},
+ * {@code cert.getType().equals(certPath.getType())} must be
+ * {@code true}.
* <p>
- * The list of <code>Certificate</code>s is an ordered <code>List</code> of
- * zero or more <code>Certificate</code>s. This <code>List</code> and all
- * of the <code>Certificate</code>s contained in it must be immutable.
+ * The list of {@code Certificate}s is an ordered {@code List} of
+ * zero or more {@code Certificate}s. This {@code List} and all
+ * of the {@code Certificate}s contained in it must be immutable.
* <p>
- * Each <code>CertPath</code> object must support one or more encodings
+ * Each {@code CertPath} object must support one or more encodings
* so that the object can be translated into a byte array for storage or
* transmission to other parties. Preferably, these encodings should be
* well-documented standards (such as PKCS#7). One of the encodings supported
- * by a <code>CertPath</code> is considered the default encoding. This
+ * by a {@code CertPath} is considered the default encoding. This
* encoding is used if no encoding is explicitly requested (for the
* {@link #getEncoded() getEncoded()} method, for instance).
* <p>
- * All <code>CertPath</code> objects are also <code>Serializable</code>.
- * <code>CertPath</code> objects are resolved into an alternate
+ * All {@code CertPath} objects are also {@code Serializable}.
+ * {@code CertPath} objects are resolved into an alternate
* {@link CertPathRep CertPathRep} object during serialization. This allows
- * a <code>CertPath</code> object to be serialized into an equivalent
+ * a {@code CertPath} object to be serialized into an equivalent
* representation regardless of its underlying implementation.
* <p>
- * <code>CertPath</code> objects can be created with a
- * <code>CertificateFactory</code> or they can be returned by other classes,
- * such as a <code>CertPathBuilder</code>.
+ * {@code CertPath} objects can be created with a
+ * {@code CertificateFactory} or they can be returned by other classes,
+ * such as a {@code CertPathBuilder}.
* <p>
- * By convention, X.509 <code>CertPath</code>s (consisting of
- * <code>X509Certificate</code>s), are ordered starting with the target
+ * By convention, X.509 {@code CertPath}s (consisting of
+ * {@code X509Certificate}s), are ordered starting with the target
* certificate and ending with a certificate issued by the trust anchor. That
* is, the issuer of one certificate is the subject of the following one. The
* certificate representing the {@link TrustAnchor TrustAnchor} should not be
- * included in the certification path. Unvalidated X.509 <code>CertPath</code>s
- * may not follow these conventions. PKIX <code>CertPathValidator</code>s will
+ * included in the certification path. Unvalidated X.509 {@code CertPath}s
+ * may not follow these conventions. PKIX {@code CertPathValidator}s will
* detect any departure from these conventions that cause the certification
- * path to be invalid and throw a <code>CertPathValidatorException</code>.
+ * path to be invalid and throw a {@code CertPathValidatorException}.
*
* <p> Every implementation of the Java platform is required to support the
- * following standard <code>CertPath</code> encodings:
+ * following standard {@code CertPath} encodings:
* <ul>
- * <li><tt>PKCS7</tt></li>
- * <li><tt>PkiPath</tt></li>
+ * <li>{@code PKCS7}</li>
+ * <li>{@code PkiPath}</li>
* </ul>
* These encodings are described in the <a href=
* "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertPathEncodings">
@@ -99,17 +99,17 @@
* <p>
* <b>Concurrent Access</b>
* <p>
- * All <code>CertPath</code> objects must be thread-safe. That is, multiple
+ * All {@code CertPath} objects must be thread-safe. That is, multiple
* threads may concurrently invoke the methods defined in this class on a
- * single <code>CertPath</code> object (or more than one) with no
- * ill effects. This is also true for the <code>List</code> returned by
- * <code>CertPath.getCertificates</code>.
+ * single {@code CertPath} object (or more than one) with no
+ * ill effects. This is also true for the {@code List} returned by
+ * {@code CertPath.getCertificates}.
* <p>
- * Requiring <code>CertPath</code> objects to be immutable and thread-safe
+ * Requiring {@code CertPath} objects to be immutable and thread-safe
* allows them to be passed around to various pieces of code without worrying
* about coordinating access. Providing this thread-safety is
- * generally not difficult, since the <code>CertPath</code> and
- * <code>List</code> objects in question are immutable.
+ * generally not difficult, since the {@code CertPath} and
+ * {@code List} objects in question are immutable.
*
* @see CertificateFactory
* @see CertPathBuilder
@@ -124,25 +124,25 @@
private String type; // the type of certificates in this chain
/**
- * Creates a <code>CertPath</code> of the specified type.
+ * Creates a {@code CertPath} of the specified type.
* <p>
* This constructor is protected because most users should use a
- * <code>CertificateFactory</code> to create <code>CertPath</code>s.
+ * {@code CertificateFactory} to create {@code CertPath}s.
*
* @param type the standard name of the type of
- * <code>Certificate</code>s in this path
+ * {@code Certificate}s in this path
*/
protected CertPath(String type) {
this.type = type;
}
/**
- * Returns the type of <code>Certificate</code>s in this certification
+ * Returns the type of {@code Certificate}s in this certification
* path. This is the same string that would be returned by
* {@link java.security.cert.Certificate#getType() cert.getType()}
- * for all <code>Certificate</code>s in the certification path.
+ * for all {@code Certificate}s in the certification path.
*
- * @return the type of <code>Certificate</code>s in this certification
+ * @return the type of {@code Certificate}s in this certification
* path (never null)
*/
public String getType() {
@@ -152,21 +152,21 @@
/**
* Returns an iteration of the encodings supported by this certification
* path, with the default encoding first. Attempts to modify the returned
- * <code>Iterator</code> via its <code>remove</code> method result in an
- * <code>UnsupportedOperationException</code>.
+ * {@code Iterator} via its {@code remove} method result in an
+ * {@code UnsupportedOperationException}.
*
- * @return an <code>Iterator</code> over the names of the supported
+ * @return an {@code Iterator} over the names of the supported
* encodings (as Strings)
*/
public abstract Iterator<String> getEncodings();
/**
* Compares this certification path for equality with the specified
- * object. Two <code>CertPath</code>s are equal if and only if their
- * types are equal and their certificate <code>List</code>s (and by
- * implication the <code>Certificate</code>s in those <code>List</code>s)
- * are equal. A <code>CertPath</code> is never equal to an object that is
- * not a <code>CertPath</code>.
+ * object. Two {@code CertPath}s are equal if and only if their
+ * types are equal and their certificate {@code List}s (and by
+ * implication the {@code Certificate}s in those {@code List}s)
+ * are equal. A {@code CertPath} is never equal to an object that is
+ * not a {@code CertPath}.
* <p>
* This algorithm is implemented by this method. If it is overridden,
* the behavior specified here must be maintained.
@@ -195,14 +195,14 @@
* Returns the hashcode for this certification path. The hash code of
* a certification path is defined to be the result of the following
* calculation:
- * <pre><code>
+ * <pre>{@code
* hashCode = path.getType().hashCode();
* hashCode = 31*hashCode + path.getCertificates().hashCode();
- * </code></pre>
- * This ensures that <code>path1.equals(path2)</code> implies that
- * <code>path1.hashCode()==path2.hashCode()</code> for any two certification
- * paths, <code>path1</code> and <code>path2</code>, as required by the
- * general contract of <code>Object.hashCode</code>.
+ * }</pre>
+ * This ensures that {@code path1.equals(path2)} implies that
+ * {@code path1.hashCode()==path2.hashCode()} for any two certification
+ * paths, {@code path1} and {@code path2}, as required by the
+ * general contract of {@code Object.hashCode}.
*
* @return the hashcode value for this certification path
*/
@@ -214,8 +214,8 @@
/**
* Returns a string representation of this certification path.
- * This calls the <code>toString</code> method on each of the
- * <code>Certificate</code>s in the path.
+ * This calls the {@code toString} method on each of the
+ * {@code Certificate}s in the path.
*
* @return a string representation of this certification path
*/
@@ -266,20 +266,20 @@
/**
* Returns the list of certificates in this certification path.
- * The <code>List</code> returned must be immutable and thread-safe.
+ * The {@code List} returned must be immutable and thread-safe.
*
- * @return an immutable <code>List</code> of <code>Certificate</code>s
+ * @return an immutable {@code List} of {@code Certificate}s
* (may be empty, but not null)
*/
public abstract List<? extends Certificate> getCertificates();
/**
- * Replaces the <code>CertPath</code> to be serialized with a
- * <code>CertPathRep</code> object.
+ * Replaces the {@code CertPath} to be serialized with a
+ * {@code CertPathRep} object.
*
- * @return the <code>CertPathRep</code> to be serialized
+ * @return the {@code CertPathRep} to be serialized
*
- * @throws ObjectStreamException if a <code>CertPathRep</code> object
+ * @throws ObjectStreamException if a {@code CertPathRep} object
* representing this certification path could not be created
*/
protected Object writeReplace() throws ObjectStreamException {
@@ -295,7 +295,7 @@
}
/**
- * Alternate <code>CertPath</code> class for serialization.
+ * Alternate {@code CertPath} class for serialization.
* @since 1.4
*/
protected static class CertPathRep implements Serializable {
@@ -308,10 +308,10 @@
private byte[] data;
/**
- * Creates a <code>CertPathRep</code> with the specified
+ * Creates a {@code CertPathRep} with the specified
* type and encoded form of a certification path.
*
- * @param type the standard name of a <code>CertPath</code> type
+ * @param type the standard name of a {@code CertPath} type
* @param data the encoded form of the certification path
*/
protected CertPathRep(String type, byte[] data) {
@@ -320,11 +320,11 @@
}
/**
- * Returns a <code>CertPath</code> constructed from the type and data.
+ * Returns a {@code CertPath} constructed from the type and data.
*
- * @return the resolved <code>CertPath</code> object
+ * @return the resolved {@code CertPath} object
*
- * @throws ObjectStreamException if a <code>CertPath</code> could not
+ * @throws ObjectStreamException if a {@code CertPath} could not
* be constructed
*/
protected Object readResolve() throws ObjectStreamException {
diff --git a/ojluni/src/main/java/java/security/cert/CertPathParameters.java b/ojluni/src/main/java/java/security/cert/CertPathParameters.java
index 46f9d88..ace1b21 100644
--- a/ojluni/src/main/java/java/security/cert/CertPathParameters.java
+++ b/ojluni/src/main/java/java/security/cert/CertPathParameters.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,8 +28,8 @@
/**
* A specification of certification path algorithm parameters.
* The purpose of this interface is to group (and provide type safety for)
- * all <code>CertPath</code> parameter specifications. All
- * <code>CertPath</code> parameter specifications must implement this
+ * all {@code CertPath} parameter specifications. All
+ * {@code CertPath} parameter specifications must implement this
* interface.
*
* @author Yassir Elley
@@ -40,10 +40,10 @@
public interface CertPathParameters extends Cloneable {
/**
- * Makes a copy of this <code>CertPathParameters</code>. Changes to the
+ * Makes a copy of this {@code CertPathParameters}. Changes to the
* copy will not affect the original and vice versa.
*
- * @return a copy of this <code>CertPathParameters</code>
+ * @return a copy of this {@code CertPathParameters}
*/
Object clone();
}
diff --git a/ojluni/src/main/java/java/security/cert/CertSelector.java b/ojluni/src/main/java/java/security/cert/CertSelector.java
index 5ee1f71..a06cc84 100644
--- a/ojluni/src/main/java/java/security/cert/CertSelector.java
+++ b/ojluni/src/main/java/java/security/cert/CertSelector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,9 +27,9 @@
/**
* A selector that defines a set of criteria for selecting
- * <code>Certificate</code>s. Classes that implement this interface
- * are often used to specify which <code>Certificate</code>s should
- * be retrieved from a <code>CertStore</code>.
+ * {@code Certificate}s. Classes that implement this interface
+ * are often used to specify which {@code Certificate}s should
+ * be retrieved from a {@code CertStore}.
* <p>
* <b>Concurrent Access</b>
* <p>
@@ -49,19 +49,19 @@
public interface CertSelector extends Cloneable {
/**
- * Decides whether a <code>Certificate</code> should be selected.
+ * Decides whether a {@code Certificate} should be selected.
*
- * @param cert the <code>Certificate</code> to be checked
- * @return <code>true</code> if the <code>Certificate</code>
- * should be selected, <code>false</code> otherwise
+ * @param cert the {@code Certificate} to be checked
+ * @return {@code true} if the {@code Certificate}
+ * should be selected, {@code false} otherwise
*/
boolean match(Certificate cert);
/**
- * Makes a copy of this <code>CertSelector</code>. Changes to the
+ * Makes a copy of this {@code CertSelector}. Changes to the
* copy will not affect the original and vice versa.
*
- * @return a copy of this <code>CertSelector</code>
+ * @return a copy of this {@code CertSelector}
*/
Object clone();
}
diff --git a/ojluni/src/main/java/java/security/cert/CertStore.java b/ojluni/src/main/java/java/security/cert/CertStore.java
index bc02510..add36cd 100644
--- a/ojluni/src/main/java/java/security/cert/CertStore.java
+++ b/ojluni/src/main/java/java/security/cert/CertStore.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -38,25 +38,25 @@
import sun.security.jca.GetInstance.Instance;
/**
- * A class for retrieving <code>Certificate</code>s and <code>CRL</code>s
+ * A class for retrieving {@code Certificate}s and {@code CRL}s
* from a repository.
* <p>
* This class uses a provider-based architecture.
- * To create a <code>CertStore</code>, call one of the static
- * <code>getInstance</code> methods, passing in the type of
- * <code>CertStore</code> desired, any applicable initialization parameters
+ * To create a {@code CertStore}, call one of the static
+ * {@code getInstance} methods, passing in the type of
+ * {@code CertStore} desired, any applicable initialization parameters
* and optionally the name of the provider desired.
* <p>
- * Once the <code>CertStore</code> has been created, it can be used to
- * retrieve <code>Certificate</code>s and <code>CRL</code>s by calling its
+ * Once the {@code CertStore} has been created, it can be used to
+ * retrieve {@code Certificate}s and {@code CRL}s by calling its
* {@link #getCertificates(CertSelector selector) getCertificates} and
* {@link #getCRLs(CRLSelector selector) getCRLs} methods.
* <p>
* Unlike a {@link java.security.KeyStore KeyStore}, which provides access
* to a cache of private keys and trusted certificates, a
- * <code>CertStore</code> is designed to provide access to a potentially
+ * {@code CertStore} is designed to provide access to a potentially
* vast repository of untrusted certificates and CRLs. For example, an LDAP
- * implementation of <code>CertStore</code> provides access to certificates
+ * implementation of {@code CertStore} provides access to certificates
* and CRLs stored in one or more directories using the LDAP protocol and the
* schema as defined in the RFC service attribute.
*
@@ -84,10 +84,10 @@
* <p>
* <b>Concurrent Access</b>
* <p>
- * All public methods of <code>CertStore</code> objects must be thread-safe.
+ * All public methods of {@code CertStore} objects must be thread-safe.
* That is, multiple threads may concurrently invoke these methods on a
- * single <code>CertStore</code> object (or more than one) with no
- * ill effects. This allows a <code>CertPathBuilder</code> to search for a
+ * single {@code CertStore} object (or more than one) with no
+ * ill effects. This allows a {@code CertPathBuilder} to search for a
* CRL while simultaneously searching for further certificates, for instance.
* <p>
* The static methods of this class are also guaranteed to be thread-safe.
@@ -113,13 +113,13 @@
private CertStoreParameters params;
/**
- * Creates a <code>CertStore</code> object of the given type, and
+ * Creates a {@code CertStore} object of the given type, and
* encapsulates the given provider implementation (SPI object) in it.
*
* @param storeSpi the provider implementation
* @param provider the provider
* @param type the type
- * @param params the initialization parameters (may be <code>null</code>)
+ * @param params the initialization parameters (may be {@code null})
*/
protected CertStore(CertStoreSpi storeSpi, Provider provider,
String type, CertStoreParameters params) {
@@ -131,28 +131,28 @@
}
/**
- * Returns a <code>Collection</code> of <code>Certificate</code>s that
- * match the specified selector. If no <code>Certificate</code>s
- * match the selector, an empty <code>Collection</code> will be returned.
+ * Returns a {@code Collection} of {@code Certificate}s that
+ * match the specified selector. If no {@code Certificate}s
+ * match the selector, an empty {@code Collection} will be returned.
* <p>
- * For some <code>CertStore</code> types, the resulting
- * <code>Collection</code> may not contain <b>all</b> of the
- * <code>Certificate</code>s that match the selector. For instance,
- * an LDAP <code>CertStore</code> may not search all entries in the
+ * For some {@code CertStore} types, the resulting
+ * {@code Collection} may not contain <b>all</b> of the
+ * {@code Certificate}s that match the selector. For instance,
+ * an LDAP {@code CertStore} may not search all entries in the
* directory. Instead, it may just search entries that are likely to
- * contain the <code>Certificate</code>s it is looking for.
+ * contain the {@code Certificate}s it is looking for.
* <p>
- * Some <code>CertStore</code> implementations (especially LDAP
- * <code>CertStore</code>s) may throw a <code>CertStoreException</code>
- * unless a non-null <code>CertSelector</code> is provided that
+ * Some {@code CertStore} implementations (especially LDAP
+ * {@code CertStore}s) may throw a {@code CertStoreException}
+ * unless a non-null {@code CertSelector} is provided that
* includes specific criteria that can be used to find the certificates.
* Issuer and/or subject names are especially useful criteria.
*
- * @param selector A <code>CertSelector</code> used to select which
- * <code>Certificate</code>s should be returned. Specify <code>null</code>
- * to return all <code>Certificate</code>s (if supported).
- * @return A <code>Collection</code> of <code>Certificate</code>s that
- * match the specified selector (never <code>null</code>)
+ * @param selector A {@code CertSelector} used to select which
+ * {@code Certificate}s should be returned. Specify {@code null}
+ * to return all {@code Certificate}s (if supported).
+ * @return A {@code Collection} of {@code Certificate}s that
+ * match the specified selector (never {@code null})
* @throws CertStoreException if an exception occurs
*/
public final Collection<? extends Certificate> getCertificates
@@ -161,28 +161,28 @@
}
/**
- * Returns a <code>Collection</code> of <code>CRL</code>s that
- * match the specified selector. If no <code>CRL</code>s
- * match the selector, an empty <code>Collection</code> will be returned.
+ * Returns a {@code Collection} of {@code CRL}s that
+ * match the specified selector. If no {@code CRL}s
+ * match the selector, an empty {@code Collection} will be returned.
* <p>
- * For some <code>CertStore</code> types, the resulting
- * <code>Collection</code> may not contain <b>all</b> of the
- * <code>CRL</code>s that match the selector. For instance,
- * an LDAP <code>CertStore</code> may not search all entries in the
+ * For some {@code CertStore} types, the resulting
+ * {@code Collection} may not contain <b>all</b> of the
+ * {@code CRL}s that match the selector. For instance,
+ * an LDAP {@code CertStore} may not search all entries in the
* directory. Instead, it may just search entries that are likely to
- * contain the <code>CRL</code>s it is looking for.
+ * contain the {@code CRL}s it is looking for.
* <p>
- * Some <code>CertStore</code> implementations (especially LDAP
- * <code>CertStore</code>s) may throw a <code>CertStoreException</code>
- * unless a non-null <code>CRLSelector</code> is provided that
+ * Some {@code CertStore} implementations (especially LDAP
+ * {@code CertStore}s) may throw a {@code CertStoreException}
+ * unless a non-null {@code CRLSelector} is provided that
* includes specific criteria that can be used to find the CRLs.
* Issuer names and/or the certificate to be checked are especially useful.
*
- * @param selector A <code>CRLSelector</code> used to select which
- * <code>CRL</code>s should be returned. Specify <code>null</code>
- * to return all <code>CRL</code>s (if supported).
- * @return A <code>Collection</code> of <code>CRL</code>s that
- * match the specified selector (never <code>null</code>)
+ * @param selector A {@code CRLSelector} used to select which
+ * {@code CRL}s should be returned. Specify {@code null}
+ * to return all {@code CRL}s (if supported).
+ * @return A {@code Collection} of {@code CRL}s that
+ * match the specified selector (never {@code null})
* @throws CertStoreException if an exception occurs
*/
public final Collection<? extends CRL> getCRLs(CRLSelector selector)
@@ -191,8 +191,8 @@
}
/**
- * Returns a <code>CertStore</code> object that implements the specified
- * <code>CertStore</code> type and is initialized with the specified
+ * Returns a {@code CertStore} object that implements the specified
+ * {@code CertStore} type and is initialized with the specified
* parameters.
*
* <p> This method traverses the list of registered security Providers,
@@ -204,29 +204,29 @@
* <p> Note that the list of registered providers may be retrieved via
* the {@link Security#getProviders() Security.getProviders()} method.
*
- * <p>The <code>CertStore</code> that is returned is initialized with the
- * specified <code>CertStoreParameters</code>. The type of parameters
- * needed may vary between different types of <code>CertStore</code>s.
- * Note that the specified <code>CertStoreParameters</code> object is
+ * <p>The {@code CertStore} that is returned is initialized with the
+ * specified {@code CertStoreParameters}. The type of parameters
+ * needed may vary between different types of {@code CertStore}s.
+ * Note that the specified {@code CertStoreParameters} object is
* cloned.
*
- * @param type the name of the requested <code>CertStore</code> type.
+ * @param type the name of the requested {@code CertStore} type.
* See the CertStore section in the <a href=
* "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertStore">
* Java Cryptography Architecture Standard Algorithm Name Documentation</a>
* for information about standard types.
*
- * @param params the initialization parameters (may be <code>null</code>).
+ * @param params the initialization parameters (may be {@code null}).
*
- * @return a <code>CertStore</code> object that implements the specified
- * <code>CertStore</code> type.
+ * @return a {@code CertStore} object that implements the specified
+ * {@code CertStore} type.
*
* @throws NoSuchAlgorithmException if no Provider supports a
* CertStoreSpi implementation for the specified type.
*
* @throws InvalidAlgorithmParameterException if the specified
* initialization parameters are inappropriate for this
- * <code>CertStore</code>.
+ * {@code CertStore}.
*
* @see java.security.Provider
*/
@@ -253,8 +253,8 @@
}
/**
- * Returns a <code>CertStore</code> object that implements the specified
- * <code>CertStore</code> type.
+ * Returns a {@code CertStore} object that implements the specified
+ * {@code CertStore} type.
*
* <p> A new CertStore object encapsulating the
* CertStoreSpi implementation from the specified provider
@@ -264,23 +264,23 @@
* <p> Note that the list of registered providers may be retrieved via
* the {@link Security#getProviders() Security.getProviders()} method.
*
- * <p>The <code>CertStore</code> that is returned is initialized with the
- * specified <code>CertStoreParameters</code>. The type of parameters
- * needed may vary between different types of <code>CertStore</code>s.
- * Note that the specified <code>CertStoreParameters</code> object is
+ * <p>The {@code CertStore} that is returned is initialized with the
+ * specified {@code CertStoreParameters}. The type of parameters
+ * needed may vary between different types of {@code CertStore}s.
+ * Note that the specified {@code CertStoreParameters} object is
* cloned.
*
- * @param type the requested <code>CertStore</code> type.
+ * @param type the requested {@code CertStore} type.
* See the CertStore section in the <a href=
* "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertStore">
* Java Cryptography Architecture Standard Algorithm Name Documentation</a>
* for information about standard types.
*
- * @param params the initialization parameters (may be <code>null</code>).
+ * @param params the initialization parameters (may be {@code null}).
*
* @param provider the name of the provider.
*
- * @return a <code>CertStore</code> object that implements the
+ * @return a {@code CertStore} object that implements the
* specified type.
*
* @throws NoSuchAlgorithmException if a CertStoreSpi
@@ -289,12 +289,12 @@
*
* @throws InvalidAlgorithmParameterException if the specified
* initialization parameters are inappropriate for this
- * <code>CertStore</code>.
+ * {@code CertStore}.
*
* @throws NoSuchProviderException if the specified provider is not
* registered in the security provider list.
*
- * @exception IllegalArgumentException if the <code>provider</code> is
+ * @exception IllegalArgumentException if the {@code provider} is
* null or empty.
*
* @see java.security.Provider
@@ -314,31 +314,31 @@
}
/**
- * Returns a <code>CertStore</code> object that implements the specified
- * <code>CertStore</code> type.
+ * Returns a {@code CertStore} object that implements the specified
+ * {@code CertStore} type.
*
* <p> A new CertStore object encapsulating the
* CertStoreSpi implementation from the specified Provider
* object is returned. Note that the specified Provider object
* does not have to be registered in the provider list.
*
- * <p>The <code>CertStore</code> that is returned is initialized with the
- * specified <code>CertStoreParameters</code>. The type of parameters
- * needed may vary between different types of <code>CertStore</code>s.
- * Note that the specified <code>CertStoreParameters</code> object is
+ * <p>The {@code CertStore} that is returned is initialized with the
+ * specified {@code CertStoreParameters}. The type of parameters
+ * needed may vary between different types of {@code CertStore}s.
+ * Note that the specified {@code CertStoreParameters} object is
* cloned.
*
- * @param type the requested <code>CertStore</code> type.
+ * @param type the requested {@code CertStore} type.
* See the CertStore section in the <a href=
* "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertStore">
* Java Cryptography Architecture Standard Algorithm Name Documentation</a>
* for information about standard types.
*
- * @param params the initialization parameters (may be <code>null</code>).
+ * @param params the initialization parameters (may be {@code null}).
*
* @param provider the provider.
*
- * @return a <code>CertStore</code> object that implements the
+ * @return a {@code CertStore} object that implements the
* specified type.
*
* @exception NoSuchAlgorithmException if a CertStoreSpi
@@ -347,9 +347,9 @@
*
* @throws InvalidAlgorithmParameterException if the specified
* initialization parameters are inappropriate for this
- * <code>CertStore</code>
+ * {@code CertStore}
*
- * @exception IllegalArgumentException if the <code>provider</code> is
+ * @exception IllegalArgumentException if the {@code provider} is
* null.
*
* @see java.security.Provider
@@ -368,55 +368,53 @@
}
/**
- * Returns the parameters used to initialize this <code>CertStore</code>.
- * Note that the <code>CertStoreParameters</code> object is cloned before
+ * Returns the parameters used to initialize this {@code CertStore}.
+ * Note that the {@code CertStoreParameters} object is cloned before
* it is returned.
*
- * @return the parameters used to initialize this <code>CertStore</code>
- * (may be <code>null</code>)
+ * @return the parameters used to initialize this {@code CertStore}
+ * (may be {@code null})
*/
public final CertStoreParameters getCertStoreParameters() {
return (params == null ? null : (CertStoreParameters) params.clone());
}
/**
- * Returns the type of this <code>CertStore</code>.
+ * Returns the type of this {@code CertStore}.
*
- * @return the type of this <code>CertStore</code>
+ * @return the type of this {@code CertStore}
*/
public final String getType() {
return this.type;
}
/**
- * Returns the provider of this <code>CertStore</code>.
+ * Returns the provider of this {@code CertStore}.
*
- * @return the provider of this <code>CertStore</code>
+ * @return the provider of this {@code CertStore}
*/
public final Provider getProvider() {
return this.provider;
}
/**
- * Returns the default <code>CertStore</code> type as specified in the
- * Java security properties file, or the string "LDAP" if no
- * such property exists. The Java security properties file is located in
- * the file named <JAVA_HOME>/lib/security/java.security.
- * <JAVA_HOME> refers to the value of the java.home system property,
- * and specifies the directory where the JRE is installed.
+ * Returns the default {@code CertStore} type as specified by the
+ * {@code certstore.type} security property, or the string
+ * {@literal "LDAP"} if no such property exists.
*
- * <p>The default <code>CertStore</code> type can be used by applications
+ * <p>The default {@code CertStore} type can be used by applications
* that do not want to use a hard-coded type when calling one of the
- * <code>getInstance</code> methods, and want to provide a default
- * <code>CertStore</code> type in case a user does not specify its own.
+ * {@code getInstance} methods, and want to provide a default
+ * {@code CertStore} type in case a user does not specify its own.
*
- * <p>The default <code>CertStore</code> type can be changed by setting
- * the value of the "certstore.type" security property (in the Java
- * security properties file) to the desired type.
+ * <p>The default {@code CertStore} type can be changed by setting
+ * the value of the {@code certstore.type} security property to the
+ * desired type.
*
- * @return the default <code>CertStore</code> type as specified in the
- * Java security properties file, or the string "LDAP"
- * if no such property exists.
+ * @see java.security.Security security properties
+ * @return the default {@code CertStore} type as specified by the
+ * {@code certstore.type} security property, or the string
+ * {@literal "LDAP"} if no such property exists.
*/
public final static String getDefaultType() {
String cstype;
diff --git a/ojluni/src/main/java/java/security/cert/CertStoreException.java b/ojluni/src/main/java/java/security/cert/CertStoreException.java
index 31baf64..77b1c23 100644
--- a/ojluni/src/main/java/java/security/cert/CertStoreException.java
+++ b/ojluni/src/main/java/java/security/cert/CertStoreException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,9 +29,9 @@
/**
* An exception indicating one of a variety of problems retrieving
- * certificates and CRLs from a <code>CertStore</code>.
+ * certificates and CRLs from a {@code CertStore}.
* <p>
- * A <code>CertStoreException</code> provides support for wrapping
+ * A {@code CertStoreException} provides support for wrapping
* exceptions. The {@link #getCause getCause} method returns the throwable,
* if any, that caused this exception to be thrown.
* <p>
@@ -53,7 +53,7 @@
private static final long serialVersionUID = 2395296107471573245L;
/**
- * Creates a <code>CertStoreException</code> with <code>null</code> as
+ * Creates a {@code CertStoreException} with {@code null} as
* its detail message.
*/
public CertStoreException() {
@@ -61,8 +61,8 @@
}
/**
- * Creates a <code>CertStoreException</code> with the given detail
- * message. A detail message is a <code>String</code> that describes this
+ * Creates a {@code CertStoreException} with the given detail
+ * message. A detail message is a {@code String} that describes this
* particular exception.
*
* @param msg the detail message
@@ -72,15 +72,15 @@
}
/**
- * Creates a <code>CertStoreException</code> that wraps the specified
+ * Creates a {@code CertStoreException} that wraps the specified
* throwable. This allows any exception to be converted into a
- * <code>CertStoreException</code>, while retaining information about the
+ * {@code CertStoreException}, while retaining information about the
* cause, which may be useful for debugging. The detail message is
- * set to (<code>cause==null ? null : cause.toString()</code>) (which
+ * set to ({@code cause==null ? null : cause.toString()}) (which
* typically contains the class and detail message of cause).
*
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause getCause()} method). (A <code>null</code> value is
+ * {@link #getCause getCause()} method). (A {@code null} value is
* permitted, and indicates that the cause is nonexistent or unknown.)
*/
public CertStoreException(Throwable cause) {
@@ -88,12 +88,12 @@
}
/**
- * Creates a <code>CertStoreException</code> with the specified detail
+ * Creates a {@code CertStoreException} with the specified detail
* message and cause.
*
* @param msg the detail message
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause getCause()} method). (A <code>null</code> value is
+ * {@link #getCause getCause()} method). (A {@code null} value is
* permitted, and indicates that the cause is nonexistent or unknown.)
*/
public CertStoreException(String msg, Throwable cause) {
diff --git a/ojluni/src/main/java/java/security/cert/CertStoreParameters.java b/ojluni/src/main/java/java/security/cert/CertStoreParameters.java
index d410dc7..9938ba2 100644
--- a/ojluni/src/main/java/java/security/cert/CertStoreParameters.java
+++ b/ojluni/src/main/java/java/security/cert/CertStoreParameters.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,20 +26,20 @@
package java.security.cert;
/**
- * A specification of <code>CertStore</code> parameters.
+ * A specification of {@code CertStore} parameters.
* <p>
* The purpose of this interface is to group (and provide type safety for)
- * all <code>CertStore</code> parameter specifications. All
- * <code>CertStore</code> parameter specifications must implement this
+ * all {@code CertStore} parameter specifications. All
+ * {@code CertStore} parameter specifications must implement this
* interface.
* <p>
- * Typically, a <code>CertStoreParameters</code> object is passed as a parameter
+ * Typically, a {@code CertStoreParameters} object is passed as a parameter
* to one of the {@link CertStore#getInstance CertStore.getInstance} methods.
- * The <code>getInstance</code> method returns a <code>CertStore</code> that
- * is used for retrieving <code>Certificate</code>s and <code>CRL</code>s. The
- * <code>CertStore</code> that is returned is initialized with the specified
+ * The {@code getInstance} method returns a {@code CertStore} that
+ * is used for retrieving {@code Certificate}s and {@code CRL}s. The
+ * {@code CertStore} that is returned is initialized with the specified
* parameters. The type of parameters needed may vary between different types
- * of <code>CertStore</code>s.
+ * of {@code CertStore}s.
*
* @see CertStore#getInstance
*
@@ -49,32 +49,32 @@
public interface CertStoreParameters extends Cloneable {
/**
- * Makes a copy of this <code>CertStoreParameters</code>.
+ * Makes a copy of this {@code CertStoreParameters}.
* <p>
* The precise meaning of "copy" may depend on the class of
- * the <code>CertStoreParameters</code> object. A typical implementation
+ * the {@code CertStoreParameters} object. A typical implementation
* performs a "deep copy" of this object, but this is not an absolute
* requirement. Some implementations may perform a "shallow copy" of some
* or all of the fields of this object.
* <p>
- * Note that the <code>CertStore.getInstance</code> methods make a copy
- * of the specified <code>CertStoreParameters</code>. A deep copy
- * implementation of <code>clone</code> is safer and more robust, as it
- * prevents the caller from corrupting a shared <code>CertStore</code> by
+ * Note that the {@code CertStore.getInstance} methods make a copy
+ * of the specified {@code CertStoreParameters}. A deep copy
+ * implementation of {@code clone} is safer and more robust, as it
+ * prevents the caller from corrupting a shared {@code CertStore} by
* subsequently modifying the contents of its initialization parameters.
- * However, a shallow copy implementation of <code>clone</code> is more
+ * However, a shallow copy implementation of {@code clone} is more
* appropriate for applications that need to hold a reference to a
- * parameter contained in the <code>CertStoreParameters</code>. For example,
+ * parameter contained in the {@code CertStoreParameters}. For example,
* a shallow copy clone allows an application to release the resources of
- * a particular <code>CertStore</code> initialization parameter immediately,
+ * a particular {@code CertStore} initialization parameter immediately,
* rather than waiting for the garbage collection mechanism. This should
- * be done with the utmost care, since the <code>CertStore</code> may still
+ * be done with the utmost care, since the {@code CertStore} may still
* be in use by other threads.
* <p>
* Each subclass should state the precise behavior of this method so
* that users and developers know what to expect.
*
- * @return a copy of this <code>CertStoreParameters</code>
+ * @return a copy of this {@code CertStoreParameters}
*/
Object clone();
}
diff --git a/ojluni/src/main/java/java/security/cert/CertStoreSpi.java b/ojluni/src/main/java/java/security/cert/CertStoreSpi.java
index ddcf2bc..fc98e9e 100644
--- a/ojluni/src/main/java/java/security/cert/CertStoreSpi.java
+++ b/ojluni/src/main/java/java/security/cert/CertStoreSpi.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,26 +30,26 @@
/**
* The <i>Service Provider Interface</i> (<b>SPI</b>)
- * for the {@link CertStore CertStore} class. All <code>CertStore</code>
+ * for the {@link CertStore CertStore} class. All {@code CertStore}
* implementations must include a class (the SPI class) that extends
- * this class (<code>CertStoreSpi</code>), provides a constructor with
- * a single argument of type <code>CertStoreParameters</code>, and implements
+ * this class ({@code CertStoreSpi}), provides a constructor with
+ * a single argument of type {@code CertStoreParameters}, and implements
* all of its methods. In general, instances of this class should only be
- * accessed through the <code>CertStore</code> class.
+ * accessed through the {@code CertStore} class.
* For details, see the Java Cryptography Architecture.
* <p>
* <b>Concurrent Access</b>
* <p>
- * The public methods of all <code>CertStoreSpi</code> objects must be
+ * The public methods of all {@code CertStoreSpi} objects must be
* thread-safe. That is, multiple threads may concurrently invoke these
- * methods on a single <code>CertStoreSpi</code> object (or more than one)
- * with no ill effects. This allows a <code>CertPathBuilder</code> to search
+ * methods on a single {@code CertStoreSpi} object (or more than one)
+ * with no ill effects. This allows a {@code CertPathBuilder} to search
* for a CRL while simultaneously searching for further certificates, for
* instance.
* <p>
- * Simple <code>CertStoreSpi</code> implementations will probably ensure
- * thread safety by adding a <code>synchronized</code> keyword to their
- * <code>engineGetCertificates</code> and <code>engineGetCRLs</code> methods.
+ * Simple {@code CertStoreSpi} implementations will probably ensure
+ * thread safety by adding a {@code synchronized} keyword to their
+ * {@code engineGetCertificates} and {@code engineGetCRLs} methods.
* More sophisticated ones may allow truly concurrent access.
*
* @since 1.4
@@ -60,64 +60,64 @@
/**
* The sole constructor.
*
- * @param params the initialization parameters (may be <code>null</code>)
+ * @param params the initialization parameters (may be {@code null})
* @throws InvalidAlgorithmParameterException if the initialization
- * parameters are inappropriate for this <code>CertStoreSpi</code>
+ * parameters are inappropriate for this {@code CertStoreSpi}
*/
public CertStoreSpi(CertStoreParameters params)
throws InvalidAlgorithmParameterException { }
/**
- * Returns a <code>Collection</code> of <code>Certificate</code>s that
- * match the specified selector. If no <code>Certificate</code>s
- * match the selector, an empty <code>Collection</code> will be returned.
+ * Returns a {@code Collection} of {@code Certificate}s that
+ * match the specified selector. If no {@code Certificate}s
+ * match the selector, an empty {@code Collection} will be returned.
* <p>
- * For some <code>CertStore</code> types, the resulting
- * <code>Collection</code> may not contain <b>all</b> of the
- * <code>Certificate</code>s that match the selector. For instance,
- * an LDAP <code>CertStore</code> may not search all entries in the
+ * For some {@code CertStore} types, the resulting
+ * {@code Collection} may not contain <b>all</b> of the
+ * {@code Certificate}s that match the selector. For instance,
+ * an LDAP {@code CertStore} may not search all entries in the
* directory. Instead, it may just search entries that are likely to
- * contain the <code>Certificate</code>s it is looking for.
+ * contain the {@code Certificate}s it is looking for.
* <p>
- * Some <code>CertStore</code> implementations (especially LDAP
- * <code>CertStore</code>s) may throw a <code>CertStoreException</code>
- * unless a non-null <code>CertSelector</code> is provided that includes
+ * Some {@code CertStore} implementations (especially LDAP
+ * {@code CertStore}s) may throw a {@code CertStoreException}
+ * unless a non-null {@code CertSelector} is provided that includes
* specific criteria that can be used to find the certificates. Issuer
* and/or subject names are especially useful criteria.
*
- * @param selector A <code>CertSelector</code> used to select which
- * <code>Certificate</code>s should be returned. Specify <code>null</code>
- * to return all <code>Certificate</code>s (if supported).
- * @return A <code>Collection</code> of <code>Certificate</code>s that
- * match the specified selector (never <code>null</code>)
+ * @param selector A {@code CertSelector} used to select which
+ * {@code Certificate}s should be returned. Specify {@code null}
+ * to return all {@code Certificate}s (if supported).
+ * @return A {@code Collection} of {@code Certificate}s that
+ * match the specified selector (never {@code null})
* @throws CertStoreException if an exception occurs
*/
public abstract Collection<? extends Certificate> engineGetCertificates
(CertSelector selector) throws CertStoreException;
/**
- * Returns a <code>Collection</code> of <code>CRL</code>s that
- * match the specified selector. If no <code>CRL</code>s
- * match the selector, an empty <code>Collection</code> will be returned.
+ * Returns a {@code Collection} of {@code CRL}s that
+ * match the specified selector. If no {@code CRL}s
+ * match the selector, an empty {@code Collection} will be returned.
* <p>
- * For some <code>CertStore</code> types, the resulting
- * <code>Collection</code> may not contain <b>all</b> of the
- * <code>CRL</code>s that match the selector. For instance,
- * an LDAP <code>CertStore</code> may not search all entries in the
+ * For some {@code CertStore} types, the resulting
+ * {@code Collection} may not contain <b>all</b> of the
+ * {@code CRL}s that match the selector. For instance,
+ * an LDAP {@code CertStore} may not search all entries in the
* directory. Instead, it may just search entries that are likely to
- * contain the <code>CRL</code>s it is looking for.
+ * contain the {@code CRL}s it is looking for.
* <p>
- * Some <code>CertStore</code> implementations (especially LDAP
- * <code>CertStore</code>s) may throw a <code>CertStoreException</code>
- * unless a non-null <code>CRLSelector</code> is provided that includes
+ * Some {@code CertStore} implementations (especially LDAP
+ * {@code CertStore}s) may throw a {@code CertStoreException}
+ * unless a non-null {@code CRLSelector} is provided that includes
* specific criteria that can be used to find the CRLs. Issuer names
* and/or the certificate to be checked are especially useful.
*
- * @param selector A <code>CRLSelector</code> used to select which
- * <code>CRL</code>s should be returned. Specify <code>null</code>
- * to return all <code>CRL</code>s (if supported).
- * @return A <code>Collection</code> of <code>CRL</code>s that
- * match the specified selector (never <code>null</code>)
+ * @param selector A {@code CRLSelector} used to select which
+ * {@code CRL}s should be returned. Specify {@code null}
+ * to return all {@code CRL}s (if supported).
+ * @return A {@code Collection} of {@code CRL}s that
+ * match the specified selector (never {@code null})
* @throws CertStoreException if an exception occurs
*/
public abstract Collection<? extends CRL> engineGetCRLs
diff --git a/ojluni/src/main/java/java/security/cert/CertificateEncodingException.java b/ojluni/src/main/java/java/security/cert/CertificateEncodingException.java
index dbfc22c..618ee0a 100644
--- a/ojluni/src/main/java/java/security/cert/CertificateEncodingException.java
+++ b/ojluni/src/main/java/java/security/cert/CertificateEncodingException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -56,13 +56,13 @@
}
/**
- * Creates a <code>CertificateEncodingException</code> with the specified
+ * Creates a {@code CertificateEncodingException} with the specified
* detail message and cause.
*
* @param message the detail message (which is saved for later retrieval
* by the {@link #getMessage()} method).
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
@@ -71,14 +71,14 @@
}
/**
- * Creates a <code>CertificateEncodingException</code>
+ * Creates a {@code CertificateEncodingException}
* with the specified cause and a detail message of
- * <tt>(cause==null ? null : cause.toString())</tt>
+ * {@code (cause==null ? null : cause.toString())}
* (which typically contains the class and detail message of
- * <tt>cause</tt>).
+ * {@code cause}).
*
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
diff --git a/ojluni/src/main/java/java/security/cert/CertificateException.java b/ojluni/src/main/java/java/security/cert/CertificateException.java
index 1c91f9f..f663054 100644
--- a/ojluni/src/main/java/java/security/cert/CertificateException.java
+++ b/ojluni/src/main/java/java/security/cert/CertificateException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -57,13 +57,13 @@
}
/**
- * Creates a <code>CertificateException</code> with the specified
+ * Creates a {@code CertificateException} with the specified
* detail message and cause.
*
* @param message the detail message (which is saved for later retrieval
* by the {@link #getMessage()} method).
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
@@ -72,13 +72,13 @@
}
/**
- * Creates a <code>CertificateException</code> with the specified cause
- * and a detail message of <tt>(cause==null ? null : cause.toString())</tt>
+ * Creates a {@code CertificateException} with the specified cause
+ * and a detail message of {@code (cause==null ? null : cause.toString())}
* (which typically contains the class and detail message of
- * <tt>cause</tt>).
+ * {@code cause}).
*
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
diff --git a/ojluni/src/main/java/java/security/cert/CertificateExpiredException.java b/ojluni/src/main/java/java/security/cert/CertificateExpiredException.java
index e5644fa..9de0c23 100644
--- a/ojluni/src/main/java/java/security/cert/CertificateExpiredException.java
+++ b/ojluni/src/main/java/java/security/cert/CertificateExpiredException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,8 +27,8 @@
/**
* Certificate Expired Exception. This is thrown whenever the current
- * <code>Date</code> or the specified <code>Date</code> is after the
- * <code>notAfter</code> date/time specified in the validity period
+ * {@code Date} or the specified {@code Date} is after the
+ * {@code notAfter} date/time specified in the validity period
* of the certificate.
*
* @author Hemma Prafullchandra
diff --git a/ojluni/src/main/java/java/security/cert/CertificateFactory.java b/ojluni/src/main/java/java/security/cert/CertificateFactory.java
index bd0ae8c..e82a579 100644
--- a/ojluni/src/main/java/java/security/cert/CertificateFactory.java
+++ b/ojluni/src/main/java/java/security/cert/CertificateFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -41,31 +41,31 @@
/**
* This class defines the functionality of a certificate factory, which is
- * used to generate certificate, certification path (<code>CertPath</code>)
+ * used to generate certificate, certification path ({@code CertPath})
* and certificate revocation list (CRL) objects from their encodings.
*
* <p>For encodings consisting of multiple certificates, use
- * <code>generateCertificates</code> when you want to
+ * {@code generateCertificates} when you want to
* parse a collection of possibly unrelated certificates. Otherwise,
- * use <code>generateCertPath</code> when you want to generate
- * a <code>CertPath</code> (a certificate chain) and subsequently
- * validate it with a <code>CertPathValidator</code>.
+ * use {@code generateCertPath} when you want to generate
+ * a {@code CertPath} (a certificate chain) and subsequently
+ * validate it with a {@code CertPathValidator}.
*
* <p>A certificate factory for X.509 must return certificates that are an
- * instance of <code>java.security.cert.X509Certificate</code>, and CRLs
- * that are an instance of <code>java.security.cert.X509CRL</code>.
+ * instance of {@code java.security.cert.X509Certificate}, and CRLs
+ * that are an instance of {@code java.security.cert.X509CRL}.
*
* <p>The following example reads a file with Base64 encoded certificates,
* which are each bounded at the beginning by -----BEGIN CERTIFICATE-----, and
* bounded at the end by -----END CERTIFICATE-----. We convert the
- * <code>FileInputStream</code> (which does not support <code>mark</code>
- * and <code>reset</code>) to a <code>BufferedInputStream</code> (which
+ * {@code FileInputStream} (which does not support {@code mark}
+ * and {@code reset}) to a {@code BufferedInputStream} (which
* supports those methods), so that each call to
- * <code>generateCertificate</code> consumes only one certificate, and the
+ * {@code generateCertificate} consumes only one certificate, and the
* read position of the input stream is positioned to the next certificate in
- * the file:<p>
+ * the file:
*
- * <pre>
+ * <pre>{@code
* FileInputStream fis = new FileInputStream(filename);
* BufferedInputStream bis = new BufferedInputStream(fis);
*
@@ -75,10 +75,10 @@
* Certificate cert = cf.generateCertificate(bis);
* System.out.println(cert.toString());
* }
- * </pre>
+ * }</pre>
*
* <p>The following example parses a PKCS#7-formatted certificate reply stored
- * in a file and extracts all the certificates from it:<p>
+ * in a file and extracts all the certificates from it:
*
* <pre>
* FileInputStream fis = new FileInputStream(filename);
@@ -281,7 +281,7 @@
* implementation for the specified algorithm is not available
* from the specified Provider object.
*
- * @exception IllegalArgumentException if the <code>provider</code> is
+ * @exception IllegalArgumentException if the {@code provider} is
* null.
*
* @see java.security.Provider
@@ -322,17 +322,17 @@
/**
* Generates a certificate object and initializes it with
- * the data read from the input stream <code>inStream</code>.
+ * the data read from the input stream {@code inStream}.
*
* <p>In order to take advantage of the specialized certificate format
* supported by this certificate factory,
* the returned certificate object can be typecast to the corresponding
* certificate class. For example, if this certificate
* factory implements X.509 certificates, the returned certificate object
- * can be typecast to the <code>X509Certificate</code> class.
+ * can be typecast to the {@code X509Certificate} class.
*
* <p>In the case of a certificate factory for X.509 certificates, the
- * certificate provided in <code>inStream</code> must be DER-encoded and
+ * certificate provided in {@code inStream} must be DER-encoded and
* may be supplied in binary or printable (Base64) encoding. If the
* certificate is provided in Base64 encoding, it must be bounded at
* the beginning by -----BEGIN CERTIFICATE-----, and must be bounded at
@@ -347,7 +347,7 @@
* the inherent end-of-certificate marker. If the data in the input stream
* does not contain an inherent end-of-certificate marker (other
* than EOF) and there is trailing data after the certificate is parsed, a
- * <code>CertificateException</code> is thrown.
+ * {@code CertificateException} is thrown.
*
* @param inStream an input stream with the certificate data.
*
@@ -363,19 +363,19 @@
}
/**
- * Returns an iteration of the <code>CertPath</code> encodings supported
+ * Returns an iteration of the {@code CertPath} encodings supported
* by this certificate factory, with the default encoding first. See
* the CertPath Encodings section in the <a href=
* "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertPathEncodings">
* Java Cryptography Architecture Standard Algorithm Name Documentation</a>
* for information about standard encoding names and their formats.
* <p>
- * Attempts to modify the returned <code>Iterator</code> via its
- * <code>remove</code> method result in an
- * <code>UnsupportedOperationException</code>.
+ * Attempts to modify the returned {@code Iterator} via its
+ * {@code remove} method result in an
+ * {@code UnsupportedOperationException}.
*
- * @return an <code>Iterator</code> over the names of the supported
- * <code>CertPath</code> encodings (as <code>String</code>s)
+ * @return an {@code Iterator} over the names of the supported
+ * {@code CertPath} encodings (as {@code String}s)
* @since 1.4
*/
public final Iterator<String> getCertPathEncodings() {
@@ -383,15 +383,15 @@
}
/**
- * Generates a <code>CertPath</code> object and initializes it with
- * the data read from the <code>InputStream</code> inStream. The data
+ * Generates a {@code CertPath} object and initializes it with
+ * the data read from the {@code InputStream} inStream. The data
* is assumed to be in the default encoding. The name of the default
- * encoding is the first element of the <code>Iterator</code> returned by
+ * encoding is the first element of the {@code Iterator} returned by
* the {@link #getCertPathEncodings getCertPathEncodings} method.
*
- * @param inStream an <code>InputStream</code> containing the data
- * @return a <code>CertPath</code> initialized with the data from the
- * <code>InputStream</code>
+ * @param inStream an {@code InputStream} containing the data
+ * @return a {@code CertPath} initialized with the data from the
+ * {@code InputStream}
* @exception CertificateException if an exception occurs while decoding
* @since 1.4
*/
@@ -402,18 +402,18 @@
}
/**
- * Generates a <code>CertPath</code> object and initializes it with
- * the data read from the <code>InputStream</code> inStream. The data
+ * Generates a {@code CertPath} object and initializes it with
+ * the data read from the {@code InputStream} inStream. The data
* is assumed to be in the specified encoding. See
* the CertPath Encodings section in the <a href=
* "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertPathEncodings">
* Java Cryptography Architecture Standard Algorithm Name Documentation</a>
* for information about standard encoding names and their formats.
*
- * @param inStream an <code>InputStream</code> containing the data
+ * @param inStream an {@code InputStream} containing the data
* @param encoding the encoding used for the data
- * @return a <code>CertPath</code> initialized with the data from the
- * <code>InputStream</code>
+ * @return a {@code CertPath} initialized with the data from the
+ * {@code InputStream}
* @exception CertificateException if an exception occurs while decoding or
* the encoding requested is not supported
* @since 1.4
@@ -425,15 +425,15 @@
}
/**
- * Generates a <code>CertPath</code> object and initializes it with
- * a <code>List</code> of <code>Certificate</code>s.
+ * Generates a {@code CertPath} object and initializes it with
+ * a {@code List} of {@code Certificate}s.
* <p>
* The certificates supplied must be of a type supported by the
- * <code>CertificateFactory</code>. They will be copied out of the supplied
- * <code>List</code> object.
+ * {@code CertificateFactory}. They will be copied out of the supplied
+ * {@code List} object.
*
- * @param certificates a <code>List</code> of <code>Certificate</code>s
- * @return a <code>CertPath</code> initialized with the supplied list of
+ * @param certificates a {@code List} of {@code Certificate}s
+ * @return a {@code CertPath} initialized with the supplied list of
* certificates
* @exception CertificateException if an exception occurs
* @since 1.4
@@ -447,20 +447,20 @@
/**
* Returns a (possibly empty) collection view of the certificates read
- * from the given input stream <code>inStream</code>.
+ * from the given input stream {@code inStream}.
*
* <p>In order to take advantage of the specialized certificate format
* supported by this certificate factory, each element in
* the returned collection view can be typecast to the corresponding
* certificate class. For example, if this certificate
* factory implements X.509 certificates, the elements in the returned
- * collection can be typecast to the <code>X509Certificate</code> class.
+ * collection can be typecast to the {@code X509Certificate} class.
*
* <p>In the case of a certificate factory for X.509 certificates,
- * <code>inStream</code> may contain a sequence of DER-encoded certificates
+ * {@code inStream} may contain a sequence of DER-encoded certificates
* in the formats described for
* {@link #generateCertificate(java.io.InputStream) generateCertificate}.
- * In addition, <code>inStream</code> may contain a PKCS#7 certificate
+ * In addition, {@code inStream} may contain a PKCS#7 certificate
* chain. This is a PKCS#7 <i>SignedData</i> object, with the only
* significant field being <i>certificates</i>. In particular, the
* signature and the contents are ignored. This format allows multiple
@@ -487,14 +487,14 @@
/**
* Generates a certificate revocation list (CRL) object and initializes it
- * with the data read from the input stream <code>inStream</code>.
+ * with the data read from the input stream {@code inStream}.
*
* <p>In order to take advantage of the specialized CRL format
* supported by this certificate factory,
* the returned CRL object can be typecast to the corresponding
* CRL class. For example, if this certificate
* factory implements X.509 CRLs, the returned CRL object
- * can be typecast to the <code>X509CRL</code> class.
+ * can be typecast to the {@code X509CRL} class.
*
* <p>Note that if the given input stream does not support
* {@link java.io.InputStream#mark(int) mark} and
@@ -505,7 +505,7 @@
* end-of-CRL marker. If the data in the
* input stream does not contain an inherent end-of-CRL marker (other
* than EOF) and there is trailing data after the CRL is parsed, a
- * <code>CRLException</code> is thrown.
+ * {@code CRLException} is thrown.
*
* @param inStream an input stream with the CRL data.
*
@@ -522,18 +522,18 @@
/**
* Returns a (possibly empty) collection view of the CRLs read
- * from the given input stream <code>inStream</code>.
+ * from the given input stream {@code inStream}.
*
* <p>In order to take advantage of the specialized CRL format
* supported by this certificate factory, each element in
* the returned collection view can be typecast to the corresponding
* CRL class. For example, if this certificate
* factory implements X.509 CRLs, the elements in the returned
- * collection can be typecast to the <code>X509CRL</code> class.
+ * collection can be typecast to the {@code X509CRL} class.
*
* <p>In the case of a certificate factory for X.509 CRLs,
- * <code>inStream</code> may contain a sequence of DER-encoded CRLs.
- * In addition, <code>inStream</code> may contain a PKCS#7 CRL
+ * {@code inStream} may contain a sequence of DER-encoded CRLs.
+ * In addition, {@code inStream} may contain a PKCS#7 CRL
* set. This is a PKCS#7 <i>SignedData</i> object, with the only
* significant field being <i>crls</i>. In particular, the
* signature and the contents are ignored. This format allows multiple
diff --git a/ojluni/src/main/java/java/security/cert/CertificateFactorySpi.java b/ojluni/src/main/java/java/security/cert/CertificateFactorySpi.java
index ca64665..5e13831 100644
--- a/ojluni/src/main/java/java/security/cert/CertificateFactorySpi.java
+++ b/ojluni/src/main/java/java/security/cert/CertificateFactorySpi.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,18 +35,18 @@
/**
* This class defines the <i>Service Provider Interface</i> (<b>SPI</b>)
- * for the <code>CertificateFactory</code> class.
+ * for the {@code CertificateFactory} class.
* All the abstract methods in this class must be implemented by each
* cryptographic service provider who wishes to supply the implementation
* of a certificate factory for a particular certificate type, e.g., X.509.
*
* <p>Certificate factories are used to generate certificate, certification path
- * (<code>CertPath</code>) and certificate revocation list (CRL) objects from
+ * ({@code CertPath}) and certificate revocation list (CRL) objects from
* their encodings.
*
* <p>A certificate factory for X.509 must return certificates that are an
- * instance of <code>java.security.cert.X509Certificate</code>, and CRLs
- * that are an instance of <code>java.security.cert.X509CRL</code>.
+ * instance of {@code java.security.cert.X509Certificate}, and CRLs
+ * that are an instance of {@code java.security.cert.X509CRL}.
*
* @author Hemma Prafullchandra
* @author Jan Luehe
@@ -67,17 +67,17 @@
/**
* Generates a certificate object and initializes it with
- * the data read from the input stream <code>inStream</code>.
+ * the data read from the input stream {@code inStream}.
*
* <p>In order to take advantage of the specialized certificate format
* supported by this certificate factory,
* the returned certificate object can be typecast to the corresponding
* certificate class. For example, if this certificate
* factory implements X.509 certificates, the returned certificate object
- * can be typecast to the <code>X509Certificate</code> class.
+ * can be typecast to the {@code X509Certificate} class.
*
* <p>In the case of a certificate factory for X.509 certificates, the
- * certificate provided in <code>inStream</code> must be DER-encoded and
+ * certificate provided in {@code inStream} must be DER-encoded and
* may be supplied in binary or printable (Base64) encoding. If the
* certificate is provided in Base64 encoding, it must be bounded at
* the beginning by -----BEGIN CERTIFICATE-----, and must be bounded at
@@ -92,7 +92,7 @@
* end-of-certificate marker. If the data in the
* input stream does not contain an inherent end-of-certificate marker (other
* than EOF) and there is trailing data after the certificate is parsed, a
- * <code>CertificateException</code> is thrown.
+ * {@code CertificateException} is thrown.
*
* @param inStream an input stream with the certificate data.
*
@@ -105,18 +105,18 @@
throws CertificateException;
/**
- * Generates a <code>CertPath</code> object and initializes it with
- * the data read from the <code>InputStream</code> inStream. The data
+ * Generates a {@code CertPath} object and initializes it with
+ * the data read from the {@code InputStream} inStream. The data
* is assumed to be in the default encoding.
*
* <p> This method was added to version 1.4 of the Java 2 Platform
* Standard Edition. In order to maintain backwards compatibility with
- * existing service providers, this method cannot be <code>abstract</code>
- * and by default throws an <code>UnsupportedOperationException</code>.
+ * existing service providers, this method cannot be {@code abstract}
+ * and by default throws an {@code UnsupportedOperationException}.
*
- * @param inStream an <code>InputStream</code> containing the data
- * @return a <code>CertPath</code> initialized with the data from the
- * <code>InputStream</code>
+ * @param inStream an {@code InputStream} containing the data
+ * @return a {@code CertPath} initialized with the data from the
+ * {@code InputStream}
* @exception CertificateException if an exception occurs while decoding
* @exception UnsupportedOperationException if the method is not supported
* @since 1.4
@@ -128,19 +128,19 @@
}
/**
- * Generates a <code>CertPath</code> object and initializes it with
- * the data read from the <code>InputStream</code> inStream. The data
+ * Generates a {@code CertPath} object and initializes it with
+ * the data read from the {@code InputStream} inStream. The data
* is assumed to be in the specified encoding.
*
* <p> This method was added to version 1.4 of the Java 2 Platform
* Standard Edition. In order to maintain backwards compatibility with
- * existing service providers, this method cannot be <code>abstract</code>
- * and by default throws an <code>UnsupportedOperationException</code>.
+ * existing service providers, this method cannot be {@code abstract}
+ * and by default throws an {@code UnsupportedOperationException}.
*
- * @param inStream an <code>InputStream</code> containing the data
+ * @param inStream an {@code InputStream} containing the data
* @param encoding the encoding used for the data
- * @return a <code>CertPath</code> initialized with the data from the
- * <code>InputStream</code>
+ * @return a {@code CertPath} initialized with the data from the
+ * {@code InputStream}
* @exception CertificateException if an exception occurs while decoding or
* the encoding requested is not supported
* @exception UnsupportedOperationException if the method is not supported
@@ -153,20 +153,20 @@
}
/**
- * Generates a <code>CertPath</code> object and initializes it with
- * a <code>List</code> of <code>Certificate</code>s.
+ * Generates a {@code CertPath} object and initializes it with
+ * a {@code List} of {@code Certificate}s.
* <p>
* The certificates supplied must be of a type supported by the
- * <code>CertificateFactory</code>. They will be copied out of the supplied
- * <code>List</code> object.
+ * {@code CertificateFactory}. They will be copied out of the supplied
+ * {@code List} object.
*
* <p> This method was added to version 1.4 of the Java 2 Platform
* Standard Edition. In order to maintain backwards compatibility with
- * existing service providers, this method cannot be <code>abstract</code>
- * and by default throws an <code>UnsupportedOperationException</code>.
+ * existing service providers, this method cannot be {@code abstract}
+ * and by default throws an {@code UnsupportedOperationException}.
*
- * @param certificates a <code>List</code> of <code>Certificate</code>s
- * @return a <code>CertPath</code> initialized with the supplied list of
+ * @param certificates a {@code List} of {@code Certificate}s
+ * @return a {@code CertPath} initialized with the supplied list of
* certificates
* @exception CertificateException if an exception occurs
* @exception UnsupportedOperationException if the method is not supported
@@ -180,24 +180,24 @@
}
/**
- * Returns an iteration of the <code>CertPath</code> encodings supported
+ * Returns an iteration of the {@code CertPath} encodings supported
* by this certificate factory, with the default encoding first. See
* the CertPath Encodings section in the <a href=
* "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#CertPathEncodings">
* Java Cryptography Architecture Standard Algorithm Name Documentation</a>
* for information about standard encoding names.
* <p>
- * Attempts to modify the returned <code>Iterator</code> via its
- * <code>remove</code> method result in an
- * <code>UnsupportedOperationException</code>.
+ * Attempts to modify the returned {@code Iterator} via its
+ * {@code remove} method result in an
+ * {@code UnsupportedOperationException}.
*
* <p> This method was added to version 1.4 of the Java 2 Platform
* Standard Edition. In order to maintain backwards compatibility with
- * existing service providers, this method cannot be <code>abstract</code>
- * and by default throws an <code>UnsupportedOperationException</code>.
+ * existing service providers, this method cannot be {@code abstract}
+ * and by default throws an {@code UnsupportedOperationException}.
*
- * @return an <code>Iterator</code> over the names of the supported
- * <code>CertPath</code> encodings (as <code>String</code>s)
+ * @return an {@code Iterator} over the names of the supported
+ * {@code CertPath} encodings (as {@code String}s)
* @exception UnsupportedOperationException if the method is not supported
* @since 1.4
*/
@@ -207,21 +207,21 @@
/**
* Returns a (possibly empty) collection view of the certificates read
- * from the given input stream <code>inStream</code>.
+ * from the given input stream {@code inStream}.
*
* <p>In order to take advantage of the specialized certificate format
* supported by this certificate factory, each element in
* the returned collection view can be typecast to the corresponding
* certificate class. For example, if this certificate
* factory implements X.509 certificates, the elements in the returned
- * collection can be typecast to the <code>X509Certificate</code> class.
+ * collection can be typecast to the {@code X509Certificate} class.
*
* <p>In the case of a certificate factory for X.509 certificates,
- * <code>inStream</code> may contain a single DER-encoded certificate
+ * {@code inStream} may contain a single DER-encoded certificate
* in the formats described for
* {@link CertificateFactory#generateCertificate(java.io.InputStream)
* generateCertificate}.
- * In addition, <code>inStream</code> may contain a PKCS#7 certificate
+ * In addition, {@code inStream} may contain a PKCS#7 certificate
* chain. This is a PKCS#7 <i>SignedData</i> object, with the only
* significant field being <i>certificates</i>. In particular, the
* signature and the contents are ignored. This format allows multiple
@@ -247,14 +247,14 @@
/**
* Generates a certificate revocation list (CRL) object and initializes it
- * with the data read from the input stream <code>inStream</code>.
+ * with the data read from the input stream {@code inStream}.
*
* <p>In order to take advantage of the specialized CRL format
* supported by this certificate factory,
* the returned CRL object can be typecast to the corresponding
* CRL class. For example, if this certificate
* factory implements X.509 CRLs, the returned CRL object
- * can be typecast to the <code>X509CRL</code> class.
+ * can be typecast to the {@code X509CRL} class.
*
* <p>Note that if the given input stream does not support
* {@link java.io.InputStream#mark(int) mark} and
@@ -265,7 +265,7 @@
* end-of-CRL marker. If the data in the
* input stream does not contain an inherent end-of-CRL marker (other
* than EOF) and there is trailing data after the CRL is parsed, a
- * <code>CRLException</code> is thrown.
+ * {@code CRLException} is thrown.
*
* @param inStream an input stream with the CRL data.
*
@@ -279,18 +279,18 @@
/**
* Returns a (possibly empty) collection view of the CRLs read
- * from the given input stream <code>inStream</code>.
+ * from the given input stream {@code inStream}.
*
* <p>In order to take advantage of the specialized CRL format
* supported by this certificate factory, each element in
* the returned collection view can be typecast to the corresponding
* CRL class. For example, if this certificate
* factory implements X.509 CRLs, the elements in the returned
- * collection can be typecast to the <code>X509CRL</code> class.
+ * collection can be typecast to the {@code X509CRL} class.
*
* <p>In the case of a certificate factory for X.509 CRLs,
- * <code>inStream</code> may contain a single DER-encoded CRL.
- * In addition, <code>inStream</code> may contain a PKCS#7 CRL
+ * {@code inStream} may contain a single DER-encoded CRL.
+ * In addition, {@code inStream} may contain a PKCS#7 CRL
* set. This is a PKCS#7 <i>SignedData</i> object, with the only
* significant field being <i>crls</i>. In particular, the
* signature and the contents are ignored. This format allows multiple
diff --git a/ojluni/src/main/java/java/security/cert/CertificateNotYetValidException.java b/ojluni/src/main/java/java/security/cert/CertificateNotYetValidException.java
index 13da51d..e8722bd 100644
--- a/ojluni/src/main/java/java/security/cert/CertificateNotYetValidException.java
+++ b/ojluni/src/main/java/java/security/cert/CertificateNotYetValidException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,8 +27,8 @@
/**
* Certificate is not yet valid exception. This is thrown whenever
- * the current <code>Date</code> or the specified <code>Date</code>
- * is before the <code>notBefore</code> date/time in the Certificate
+ * the current {@code Date} or the specified {@code Date}
+ * is before the {@code notBefore} date/time in the Certificate
* validity period.
*
* @author Hemma Prafullchandra
diff --git a/ojluni/src/main/java/java/security/cert/CertificateParsingException.java b/ojluni/src/main/java/java/security/cert/CertificateParsingException.java
index 3432fb0..06a7d60 100644
--- a/ojluni/src/main/java/java/security/cert/CertificateParsingException.java
+++ b/ojluni/src/main/java/java/security/cert/CertificateParsingException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -57,13 +57,13 @@
}
/**
- * Creates a <code>CertificateParsingException</code> with the specified
+ * Creates a {@code CertificateParsingException} with the specified
* detail message and cause.
*
* @param message the detail message (which is saved for later retrieval
* by the {@link #getMessage()} method).
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
@@ -72,14 +72,14 @@
}
/**
- * Creates a <code>CertificateParsingException</code> with the
+ * Creates a {@code CertificateParsingException} with the
* specified cause and a detail message of
- * <tt>(cause==null ? null : cause.toString())</tt>
+ * {@code (cause==null ? null : cause.toString())}
* (which typically contains the class and detail message of
- * <tt>cause</tt>).
+ * {@code cause}).
*
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A <tt>null</tt> value is permitted,
+ * {@link #getCause()} method). (A {@code null} value is permitted,
* and indicates that the cause is nonexistent or unknown.)
* @since 1.5
*/
diff --git a/ojluni/src/main/java/java/security/cert/CertificateRevokedException.java b/ojluni/src/main/java/java/security/cert/CertificateRevokedException.java
index a76299c..505a007 100644
--- a/ojluni/src/main/java/java/security/cert/CertificateRevokedException.java
+++ b/ojluni/src/main/java/java/security/cert/CertificateRevokedException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2014, 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,7 +32,6 @@
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
-import java.util.Map.Entry;
import javax.security.auth.x500.X500Principal;
import sun.security.util.ObjectIdentifier;
@@ -40,7 +39,7 @@
/**
* An exception that indicates an X.509 certificate is revoked. A
- * <code>CertificateRevokedException</code> contains additional information
+ * {@code CertificateRevokedException} contains additional information
* about the revoked certificate, such as the date on which the
* certificate was revoked and the reason it was revoked.
*
@@ -61,7 +60,7 @@
*/
private final CRLReason reason;
/**
- * @serial the <code>X500Principal</code> that represents the name of the
+ * @serial the {@code X500Principal} that represents the name of the
* authority that signed the certificate's revocation status information
*/
private final X500Principal authority;
@@ -69,7 +68,7 @@
private transient Map<String, Extension> extensions;
/**
- * Constructs a <code>CertificateRevokedException</code> with
+ * Constructs a {@code CertificateRevokedException} with
* the specified revocation date, reason code, authority name, and map
* of extensions.
*
@@ -79,12 +78,12 @@
* @param extensions a map of X.509 Extensions. Each key is an OID String
* that maps to the corresponding Extension. The map is copied to
* prevent subsequent modification.
- * @param authority the <code>X500Principal</code> that represents the name
+ * @param authority the {@code X500Principal} that represents the name
* of the authority that signed the certificate's revocation status
* information
- * @throws NullPointerException if <code>revocationDate</code>,
- * <code>reason</code>, <code>authority</code>, or
- * <code>extensions</code> is <code>null</code>
+ * @throws NullPointerException if {@code revocationDate},
+ * {@code reason}, {@code authority}, or
+ * {@code extensions} is {@code null}
*/
public CertificateRevokedException(Date revocationDate, CRLReason reason,
X500Principal authority, Map<String, Extension> extensions) {
@@ -95,7 +94,10 @@
this.revocationDate = new Date(revocationDate.getTime());
this.reason = reason;
this.authority = authority;
- this.extensions = new HashMap(extensions);
+ // make sure Map only contains correct types
+ this.extensions = Collections.checkedMap(new HashMap<>(),
+ String.class, Extension.class);
+ this.extensions.putAll(extensions);
}
/**
@@ -122,7 +124,7 @@
* Returns the name of the authority that signed the certificate's
* revocation status information.
*
- * @return the <code>X500Principal</code> that represents the name of the
+ * @return the {@code X500Principal} that represents the name of the
* authority that signed the certificate's revocation status information
*/
public X500Principal getAuthorityName() {
@@ -130,17 +132,17 @@
}
/**
- * Returns the invalidity date, as specifed in the Invalidity Date
- * extension of this <code>CertificateRevokedException</code>. The
+ * Returns the invalidity date, as specified in the Invalidity Date
+ * extension of this {@code CertificateRevokedException}. The
* invalidity date is the date on which it is known or suspected that the
* private key was compromised or that the certificate otherwise became
- * invalid. This implementation calls <code>getExtensions()</code> and
+ * invalid. This implementation calls {@code getExtensions()} and
* checks the returned map for an entry for the Invalidity Date extension
* OID ("2.5.29.24"). If found, it returns the invalidity date in the
* extension; otherwise null. A new Date object is returned each time the
* method is invoked to protect against subsequent modification.
*
- * @return the invalidity date, or <code>null</code> if not specified
+ * @return the invalidity date, or {@code null} if not specified
*/
public Date getInvalidityDate() {
Extension ext = getExtensions().get("2.5.29.24");
@@ -148,8 +150,7 @@
return null;
} else {
try {
- Date invalidity =
- (Date) InvalidityDateExtension.toImpl(ext).get("DATE");
+ Date invalidity = InvalidityDateExtension.toImpl(ext).get("DATE");
return new Date(invalidity.getTime());
} catch (IOException ioe) {
return null;
@@ -174,11 +175,12 @@
public String getMessage() {
return "Certificate has been revoked, reason: "
+ reason + ", revocation date: " + revocationDate
- + ", authority: " + authority + ", extensions: " + extensions;
+ + ", authority: " + authority + ", extension OIDs: "
+ + extensions.keySet();
}
/**
- * Serialize this <code>CertificateRevokedException</code> instance.
+ * Serialize this {@code CertificateRevokedException} instance.
*
* @serialData the size of the extensions map (int), followed by all of
* the extensions in the map, in no particular order. For each extension,
@@ -210,7 +212,7 @@
}
/**
- * Deserialize the <code>CertificateRevokedException</code> instance.
+ * Deserialize the {@code CertificateRevokedException} instance.
*/
private void readObject(ObjectInputStream ois)
throws IOException, ClassNotFoundException {
diff --git a/ojluni/src/main/java/java/security/cert/CollectionCertStoreParameters.java b/ojluni/src/main/java/java/security/cert/CollectionCertStoreParameters.java
index ddeea61..12bd358 100644
--- a/ojluni/src/main/java/java/security/cert/CollectionCertStoreParameters.java
+++ b/ojluni/src/main/java/java/security/cert/CollectionCertStoreParameters.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,13 +30,13 @@
import java.util.Collections;
/**
- * Parameters used as input for the Collection <code>CertStore</code>
+ * Parameters used as input for the Collection {@code CertStore}
* algorithm.
* <p>
* This class is used to provide necessary configuration parameters
- * to implementations of the Collection <code>CertStore</code>
+ * to implementations of the Collection {@code CertStore}
* algorithm. The only parameter included in this class is the
- * <code>Collection</code> from which the <code>CertStore</code> will
+ * {@code Collection} from which the {@code CertStore} will
* retrieve certificates and CRLs.
* <p>
* <b>Concurrent Access</b>
@@ -58,30 +58,30 @@
private Collection<?> coll;
/**
- * Creates an instance of <code>CollectionCertStoreParameters</code>
+ * Creates an instance of {@code CollectionCertStoreParameters}
* which will allow certificates and CRLs to be retrieved from the
- * specified <code>Collection</code>. If the specified
- * <code>Collection</code> contains an object that is not a
- * <code>Certificate</code> or <code>CRL</code>, that object will be
- * ignored by the Collection <code>CertStore</code>.
+ * specified {@code Collection}. If the specified
+ * {@code Collection} contains an object that is not a
+ * {@code Certificate} or {@code CRL}, that object will be
+ * ignored by the Collection {@code CertStore}.
* <p>
- * The <code>Collection</code> is <b>not</b> copied. Instead, a
+ * The {@code Collection} is <b>not</b> copied. Instead, a
* reference is used. This allows the caller to subsequently add or
- * remove <code>Certificates</code> or <code>CRL</code>s from the
- * <code>Collection</code>, thus changing the set of
- * <code>Certificates</code> or <code>CRL</code>s available to the
- * Collection <code>CertStore</code>. The Collection <code>CertStore</code>
- * will not modify the contents of the <code>Collection</code>.
+ * remove {@code Certificates} or {@code CRL}s from the
+ * {@code Collection}, thus changing the set of
+ * {@code Certificates} or {@code CRL}s available to the
+ * Collection {@code CertStore}. The Collection {@code CertStore}
+ * will not modify the contents of the {@code Collection}.
* <p>
- * If the <code>Collection</code> will be modified by one thread while
- * another thread is calling a method of a Collection <code>CertStore</code>
- * that has been initialized with this <code>Collection</code>, the
- * <code>Collection</code> must have fail-fast iterators.
+ * If the {@code Collection} will be modified by one thread while
+ * another thread is calling a method of a Collection {@code CertStore}
+ * that has been initialized with this {@code Collection}, the
+ * {@code Collection} must have fail-fast iterators.
*
- * @param collection a <code>Collection</code> of
- * <code>Certificate</code>s and <code>CRL</code>s
- * @exception NullPointerException if <code>collection</code> is
- * <code>null</code>
+ * @param collection a {@code Collection} of
+ * {@code Certificate}s and {@code CRL}s
+ * @exception NullPointerException if {@code collection} is
+ * {@code null}
*/
public CollectionCertStoreParameters(Collection<?> collection) {
if (collection == null)
@@ -90,22 +90,22 @@
}
/**
- * Creates an instance of <code>CollectionCertStoreParameters</code> with
+ * Creates an instance of {@code CollectionCertStoreParameters} with
* the default parameter values (an empty and immutable
- * <code>Collection</code>).
+ * {@code Collection}).
*/
public CollectionCertStoreParameters() {
coll = Collections.EMPTY_SET;
}
/**
- * Returns the <code>Collection</code> from which <code>Certificate</code>s
- * and <code>CRL</code>s are retrieved. This is <b>not</b> a copy of the
- * <code>Collection</code>, it is a reference. This allows the caller to
- * subsequently add or remove <code>Certificates</code> or
- * <code>CRL</code>s from the <code>Collection</code>.
+ * Returns the {@code Collection} from which {@code Certificate}s
+ * and {@code CRL}s are retrieved. This is <b>not</b> a copy of the
+ * {@code Collection}, it is a reference. This allows the caller to
+ * subsequently add or remove {@code Certificates} or
+ * {@code CRL}s from the {@code Collection}.
*
- * @return the <code>Collection</code> (never null)
+ * @return the {@code Collection} (never null)
*/
public Collection<?> getCollection() {
return coll;
@@ -113,7 +113,7 @@
/**
* Returns a copy of this object. Note that only a reference to the
- * <code>Collection</code> is copied, and not the contents.
+ * {@code Collection} is copied, and not the contents.
*
* @return the copy
*/
@@ -122,7 +122,7 @@
return super.clone();
} catch (CloneNotSupportedException e) {
/* Cannot happen */
- throw new InternalError(e.toString());
+ throw new InternalError(e.toString(), e);
}
}
diff --git a/ojluni/src/main/java/java/security/cert/Extension.java b/ojluni/src/main/java/java/security/cert/Extension.java
index cbf89d5..98e827c 100644
--- a/ojluni/src/main/java/java/security/cert/Extension.java
+++ b/ojluni/src/main/java/java/security/cert/Extension.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -84,7 +84,7 @@
* that are encoded as an OCTET STRING. It does not include the OCTET
* STRING tag and length.
*
- * @return a copy of the extension's value, or <code>null</code> if no
+ * @return a copy of the extension's value, or {@code null} if no
* extension value is present.
*/
byte[] getValue();
@@ -95,7 +95,7 @@
*
* @param out the output stream
* @exception IOException on encoding or output error.
- * @exception NullPointerException if <code>out</code> is <code>null</code>.
+ * @exception NullPointerException if {@code out} is {@code null}.
*/
void encode(OutputStream out) throws IOException;
}
diff --git a/ojluni/src/main/java/java/security/cert/LDAPCertStoreParameters.java b/ojluni/src/main/java/java/security/cert/LDAPCertStoreParameters.java
index 00bf2af..96fe9cd 100644
--- a/ojluni/src/main/java/java/security/cert/LDAPCertStoreParameters.java
+++ b/ojluni/src/main/java/java/security/cert/LDAPCertStoreParameters.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,10 +26,10 @@
package java.security.cert;
/**
- * Parameters used as input for the LDAP <code>CertStore</code> algorithm.
+ * Parameters used as input for the LDAP {@code CertStore} algorithm.
* <p>
* This class is used to provide necessary configuration parameters (server
- * name and port number) to implementations of the LDAP <code>CertStore</code>
+ * name and port number) to implementations of the LDAP {@code CertStore}
* algorithm.
* <p>
* <b>Concurrent Access</b>
@@ -59,13 +59,13 @@
private String serverName;
/**
- * Creates an instance of <code>LDAPCertStoreParameters</code> with the
+ * Creates an instance of {@code LDAPCertStoreParameters} with the
* specified parameter values.
*
* @param serverName the DNS name of the LDAP server
* @param port the port number of the LDAP server
- * @exception NullPointerException if <code>serverName</code> is
- * <code>null</code>
+ * @exception NullPointerException if {@code serverName} is
+ * {@code null}
*/
public LDAPCertStoreParameters(String serverName, int port) {
if (serverName == null)
@@ -75,19 +75,19 @@
}
/**
- * Creates an instance of <code>LDAPCertStoreParameters</code> with the
+ * Creates an instance of {@code LDAPCertStoreParameters} with the
* specified server name and a default port of 389.
*
* @param serverName the DNS name of the LDAP server
- * @exception NullPointerException if <code>serverName</code> is
- * <code>null</code>
+ * @exception NullPointerException if {@code serverName} is
+ * {@code null}
*/
public LDAPCertStoreParameters(String serverName) {
this(serverName, LDAP_DEFAULT_PORT);
}
/**
- * Creates an instance of <code>LDAPCertStoreParameters</code> with the
+ * Creates an instance of {@code LDAPCertStoreParameters} with the
* default parameter values (server name "localhost", port 389).
*/
public LDAPCertStoreParameters() {
@@ -97,7 +97,7 @@
/**
* Returns the DNS name of the LDAP server.
*
- * @return the name (not <code>null</code>)
+ * @return the name (not {@code null})
*/
public String getServerName() {
return serverName;
@@ -117,7 +117,7 @@
* the original and vice versa.
* <p>
* Note: this method currently performs a shallow copy of the object
- * (simply calls <code>Object.clone()</code>). This may be changed in a
+ * (simply calls {@code Object.clone()}). This may be changed in a
* future revision to perform a deep copy if new parameters are added
* that should not be shared.
*
@@ -128,7 +128,7 @@
return super.clone();
} catch (CloneNotSupportedException e) {
/* Cannot happen */
- throw new InternalError(e.toString());
+ throw new InternalError(e.toString(), e);
}
}
diff --git a/ojluni/src/main/java/java/security/cert/PKIXBuilderParameters.java b/ojluni/src/main/java/java/security/cert/PKIXBuilderParameters.java
index d1b27c6..b33e1f8 100644
--- a/ojluni/src/main/java/java/security/cert/PKIXBuilderParameters.java
+++ b/ojluni/src/main/java/java/security/cert/PKIXBuilderParameters.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,35 +32,35 @@
import java.util.Set;
/**
- * Parameters used as input for the PKIX <code>CertPathBuilder</code>
+ * Parameters used as input for the PKIX {@code CertPathBuilder}
* algorithm.
* <p>
- * A PKIX <code>CertPathBuilder</code> uses these parameters to {@link
- * CertPathBuilder#build build} a <code>CertPath</code> which has been
+ * A PKIX {@code CertPathBuilder} uses these parameters to {@link
+ * CertPathBuilder#build build} a {@code CertPath} which has been
* validated according to the PKIX certification path validation algorithm.
*
- * <p>To instantiate a <code>PKIXBuilderParameters</code> object, an
+ * <p>To instantiate a {@code PKIXBuilderParameters} object, an
* application must specify one or more <i>most-trusted CAs</i> as defined by
* the PKIX certification path validation algorithm. The most-trusted CA
* can be specified using one of two constructors. An application
* can call {@link #PKIXBuilderParameters(Set, CertSelector)
* PKIXBuilderParameters(Set, CertSelector)}, specifying a
- * <code>Set</code> of <code>TrustAnchor</code> objects, each of which
+ * {@code Set} of {@code TrustAnchor} objects, each of which
* identifies a most-trusted CA. Alternatively, an application can call
* {@link #PKIXBuilderParameters(KeyStore, CertSelector)
* PKIXBuilderParameters(KeyStore, CertSelector)}, specifying a
- * <code>KeyStore</code> instance containing trusted certificate entries, each
+ * {@code KeyStore} instance containing trusted certificate entries, each
* of which will be considered as a most-trusted CA.
*
* <p>In addition, an application must specify constraints on the target
- * certificate that the <code>CertPathBuilder</code> will attempt
+ * certificate that the {@code CertPathBuilder} will attempt
* to build a path to. The constraints are specified as a
- * <code>CertSelector</code> object. These constraints should provide the
- * <code>CertPathBuilder</code> with enough search criteria to find the target
- * certificate. Minimal criteria for an <code>X509Certificate</code> usually
+ * {@code CertSelector} object. These constraints should provide the
+ * {@code CertPathBuilder} with enough search criteria to find the target
+ * certificate. Minimal criteria for an {@code X509Certificate} usually
* include the subject name and/or one or more subject alternative names.
- * If enough criteria is not specified, the <code>CertPathBuilder</code>
- * may throw a <code>CertPathBuilderException</code>.
+ * If enough criteria is not specified, the {@code CertPathBuilder}
+ * may throw a {@code CertPathBuilderException}.
* <p>
* <b>Concurrent Access</b>
* <p>
@@ -80,23 +80,23 @@
private int maxPathLength = 5;
/**
- * Creates an instance of <code>PKIXBuilderParameters</code> with
- * the specified <code>Set</code> of most-trusted CAs.
+ * Creates an instance of {@code PKIXBuilderParameters} with
+ * the specified {@code Set} of most-trusted CAs.
* Each element of the set is a {@link TrustAnchor TrustAnchor}.
*
- * <p>Note that the <code>Set</code> is copied to protect against
+ * <p>Note that the {@code Set} is copied to protect against
* subsequent modifications.
*
- * @param trustAnchors a <code>Set</code> of <code>TrustAnchor</code>s
- * @param targetConstraints a <code>CertSelector</code> specifying the
+ * @param trustAnchors a {@code Set} of {@code TrustAnchor}s
+ * @param targetConstraints a {@code CertSelector} specifying the
* constraints on the target certificate
- * @throws InvalidAlgorithmParameterException if <code>trustAnchors</code>
- * is empty <code>(trustAnchors.isEmpty() == true)</code>
- * @throws NullPointerException if <code>trustAnchors</code> is
- * <code>null</code>
+ * @throws InvalidAlgorithmParameterException if {@code trustAnchors}
+ * is empty {@code (trustAnchors.isEmpty() == true)}
+ * @throws NullPointerException if {@code trustAnchors} is
+ * {@code null}
* @throws ClassCastException if any of the elements of
- * <code>trustAnchors</code> are not of type
- * <code>java.security.cert.TrustAnchor</code>
+ * {@code trustAnchors} are not of type
+ * {@code java.security.cert.TrustAnchor}
*/
public PKIXBuilderParameters(Set<TrustAnchor> trustAnchors, CertSelector
targetConstraints) throws InvalidAlgorithmParameterException
@@ -106,22 +106,22 @@
}
/**
- * Creates an instance of <code>PKIXBuilderParameters</code> that
+ * Creates an instance of {@code PKIXBuilderParameters} that
* populates the set of most-trusted CAs from the trusted
- * certificate entries contained in the specified <code>KeyStore</code>.
- * Only keystore entries that contain trusted <code>X509Certificate</code>s
+ * certificate entries contained in the specified {@code KeyStore}.
+ * Only keystore entries that contain trusted {@code X509Certificate}s
* are considered; all other certificate types are ignored.
*
- * @param keystore a <code>KeyStore</code> from which the set of
+ * @param keystore a {@code KeyStore} from which the set of
* most-trusted CAs will be populated
- * @param targetConstraints a <code>CertSelector</code> specifying the
+ * @param targetConstraints a {@code CertSelector} specifying the
* constraints on the target certificate
- * @throws KeyStoreException if <code>keystore</code> has not been
+ * @throws KeyStoreException if {@code keystore} has not been
* initialized
- * @throws InvalidAlgorithmParameterException if <code>keystore</code> does
+ * @throws InvalidAlgorithmParameterException if {@code keystore} does
* not contain at least one trusted certificate entry
- * @throws NullPointerException if <code>keystore</code> is
- * <code>null</code>
+ * @throws NullPointerException if {@code keystore} is
+ * {@code null}
*/
public PKIXBuilderParameters(KeyStore keystore,
CertSelector targetConstraints)
@@ -139,7 +139,7 @@
* in a certification path is not an intermediate certificate, and is not
* included in this limit. Usually the last certificate is an end entity
* certificate, but it can be a CA certificate. A PKIX
- * <code>CertPathBuilder</code> instance must not build
+ * {@code CertPathBuilder} instance must not build
* paths longer than the length specified.
*
* <p> A value of 0 implies that the path can only contain
@@ -149,14 +149,14 @@
* Setting a value less than -1 will cause an exception to be thrown.
*
* <p> If any of the CA certificates contain the
- * <code>BasicConstraintsExtension</code>, the value of the
- * <code>pathLenConstraint</code> field of the extension overrides
+ * {@code BasicConstraintsExtension}, the value of the
+ * {@code pathLenConstraint} field of the extension overrides
* the maximum path length parameter whenever the result is a
* certification path of smaller length.
*
* @param maxPathLength the maximum number of non-self-issued intermediate
* certificates that may exist in a certification path
- * @throws InvalidParameterException if <code>maxPathLength</code> is set
+ * @throws InvalidParameterException if {@code maxPathLength} is set
* to a value less than -1
*
* @see #getMaxPathLength
diff --git a/ojluni/src/main/java/java/security/cert/PKIXCertPathBuilderResult.java b/ojluni/src/main/java/java/security/cert/PKIXCertPathBuilderResult.java
index d5efbb3..3255a3b 100644
--- a/ojluni/src/main/java/java/security/cert/PKIXCertPathBuilderResult.java
+++ b/ojluni/src/main/java/java/security/cert/PKIXCertPathBuilderResult.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,14 +33,14 @@
* returned using this algorithm are also validated according to the PKIX
* certification path validation algorithm.
*
- * <p>Instances of <code>PKIXCertPathBuilderResult</code> are returned by
- * the <code>build</code> method of <code>CertPathBuilder</code>
+ * <p>Instances of {@code PKIXCertPathBuilderResult} are returned by
+ * the {@code build} method of {@code CertPathBuilder}
* objects implementing the PKIX algorithm.
*
- * <p>All <code>PKIXCertPathBuilderResult</code> objects contain the
+ * <p>All {@code PKIXCertPathBuilderResult} objects contain the
* certification path constructed by the build algorithm, the
* valid policy tree and subject public key resulting from the build
- * algorithm, and a <code>TrustAnchor</code> describing the certification
+ * algorithm, and a {@code TrustAnchor} describing the certification
* authority (CA) that served as a trust anchor for the certification path.
* <p>
* <b>Concurrent Access</b>
@@ -62,18 +62,18 @@
private CertPath certPath;
/**
- * Creates an instance of <code>PKIXCertPathBuilderResult</code>
+ * Creates an instance of {@code PKIXCertPathBuilderResult}
* containing the specified parameters.
*
- * @param certPath the validated <code>CertPath</code>
- * @param trustAnchor a <code>TrustAnchor</code> describing the CA that
+ * @param certPath the validated {@code CertPath}
+ * @param trustAnchor a {@code TrustAnchor} describing the CA that
* served as a trust anchor for the certification path
- * @param policyTree the immutable valid policy tree, or <code>null</code>
+ * @param policyTree the immutable valid policy tree, or {@code null}
* if there are no valid policies
* @param subjectPublicKey the public key of the subject
- * @throws NullPointerException if the <code>certPath</code>,
- * <code>trustAnchor</code> or <code>subjectPublicKey</code> parameters
- * are <code>null</code>
+ * @throws NullPointerException if the {@code certPath},
+ * {@code trustAnchor} or {@code subjectPublicKey} parameters
+ * are {@code null}
*/
public PKIXCertPathBuilderResult(CertPath certPath,
TrustAnchor trustAnchor, PolicyNode policyTree,
@@ -87,13 +87,13 @@
/**
* Returns the built and validated certification path. The
- * <code>CertPath</code> object does not include the trust anchor.
+ * {@code CertPath} object does not include the trust anchor.
* Instead, use the {@link #getTrustAnchor() getTrustAnchor()} method to
- * obtain the <code>TrustAnchor</code> that served as the trust anchor
+ * obtain the {@code TrustAnchor} that served as the trust anchor
* for the certification path.
*
- * @return the built and validated <code>CertPath</code> (never
- * <code>null</code>)
+ * @return the built and validated {@code CertPath} (never
+ * {@code null})
*/
public CertPath getCertPath() {
return certPath;
@@ -101,10 +101,10 @@
/**
* Return a printable representation of this
- * <code>PKIXCertPathBuilderResult</code>.
+ * {@code PKIXCertPathBuilderResult}.
*
- * @return a <code>String</code> describing the contents of this
- * <code>PKIXCertPathBuilderResult</code>
+ * @return a {@code String} describing the contents of this
+ * {@code PKIXCertPathBuilderResult}
*/
public String toString() {
StringBuffer sb = new StringBuffer();
diff --git a/ojluni/src/main/java/java/security/cert/PKIXCertPathValidatorResult.java b/ojluni/src/main/java/java/security/cert/PKIXCertPathValidatorResult.java
index caea7a2..b40cd39 100644
--- a/ojluni/src/main/java/java/security/cert/PKIXCertPathValidatorResult.java
+++ b/ojluni/src/main/java/java/security/cert/PKIXCertPathValidatorResult.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,13 +31,13 @@
* This class represents the successful result of the PKIX certification
* path validation algorithm.
*
- * <p>Instances of <code>PKIXCertPathValidatorResult</code> are returned by the
+ * <p>Instances of {@code PKIXCertPathValidatorResult} are returned by the
* {@link CertPathValidator#validate validate} method of
- * <code>CertPathValidator</code> objects implementing the PKIX algorithm.
+ * {@code CertPathValidator} objects implementing the PKIX algorithm.
*
- * <p> All <code>PKIXCertPathValidatorResult</code> objects contain the
+ * <p> All {@code PKIXCertPathValidatorResult} objects contain the
* valid policy tree and subject public key resulting from the
- * validation algorithm, as well as a <code>TrustAnchor</code> describing
+ * validation algorithm, as well as a {@code TrustAnchor} describing
* the certification authority (CA) that served as a trust anchor for the
* certification path.
* <p>
@@ -62,16 +62,16 @@
private PublicKey subjectPublicKey;
/**
- * Creates an instance of <code>PKIXCertPathValidatorResult</code>
+ * Creates an instance of {@code PKIXCertPathValidatorResult}
* containing the specified parameters.
*
- * @param trustAnchor a <code>TrustAnchor</code> describing the CA that
+ * @param trustAnchor a {@code TrustAnchor} describing the CA that
* served as a trust anchor for the certification path
- * @param policyTree the immutable valid policy tree, or <code>null</code>
+ * @param policyTree the immutable valid policy tree, or {@code null}
* if there are no valid policies
* @param subjectPublicKey the public key of the subject
- * @throws NullPointerException if the <code>subjectPublicKey</code> or
- * <code>trustAnchor</code> parameters are <code>null</code>
+ * @throws NullPointerException if the {@code subjectPublicKey} or
+ * {@code trustAnchor} parameters are {@code null}
*/
public PKIXCertPathValidatorResult(TrustAnchor trustAnchor,
PolicyNode policyTree, PublicKey subjectPublicKey)
@@ -86,10 +86,10 @@
}
/**
- * Returns the <code>TrustAnchor</code> describing the CA that served
+ * Returns the {@code TrustAnchor} describing the CA that served
* as a trust anchor for the certification path.
*
- * @return the <code>TrustAnchor</code> (never <code>null</code>)
+ * @return the {@code TrustAnchor} (never {@code null})
*/
public TrustAnchor getTrustAnchor() {
return trustAnchor;
@@ -98,18 +98,18 @@
/**
* Returns the root node of the valid policy tree resulting from the
* PKIX certification path validation algorithm. The
- * <code>PolicyNode</code> object that is returned and any objects that
+ * {@code PolicyNode} object that is returned and any objects that
* it returns through public methods are immutable.
*
* <p>Most applications will not need to examine the valid policy tree.
* They can achieve their policy processing goals by setting the
- * policy-related parameters in <code>PKIXParameters</code>. However, more
+ * policy-related parameters in {@code PKIXParameters}. However, more
* sophisticated applications, especially those that process policy
* qualifiers, may need to traverse the valid policy tree using the
* {@link PolicyNode#getParent PolicyNode.getParent} and
* {@link PolicyNode#getChildren PolicyNode.getChildren} methods.
*
- * @return the root node of the valid policy tree, or <code>null</code>
+ * @return the root node of the valid policy tree, or {@code null}
* if there are no valid policies
*/
public PolicyNode getPolicyTree() {
@@ -120,7 +120,7 @@
* Returns the public key of the subject (target) of the certification
* path, including any inherited public key parameters if applicable.
*
- * @return the public key of the subject (never <code>null</code>)
+ * @return the public key of the subject (never {@code null})
*/
public PublicKey getPublicKey() {
return subjectPublicKey;
@@ -136,16 +136,16 @@
return super.clone();
} catch (CloneNotSupportedException e) {
/* Cannot happen */
- throw new InternalError(e.toString());
+ throw new InternalError(e.toString(), e);
}
}
/**
* Return a printable representation of this
- * <code>PKIXCertPathValidatorResult</code>.
+ * {@code PKIXCertPathValidatorResult}.
*
- * @return a <code>String</code> describing the contents of this
- * <code>PKIXCertPathValidatorResult</code>
+ * @return a {@code String} describing the contents of this
+ * {@code PKIXCertPathValidatorResult}
*/
public String toString() {
StringBuffer sb = new StringBuffer();
diff --git a/ojluni/src/main/java/java/security/cert/PKIXParameters.java b/ojluni/src/main/java/java/security/cert/PKIXParameters.java
index 6f4d385..4d8a344 100644
--- a/ojluni/src/main/java/java/security/cert/PKIXParameters.java
+++ b/ojluni/src/main/java/java/security/cert/PKIXParameters.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -38,34 +38,34 @@
import java.util.Set;
/**
- * Parameters used as input for the PKIX <code>CertPathValidator</code>
+ * Parameters used as input for the PKIX {@code CertPathValidator}
* algorithm.
* <p>
- * A PKIX <code>CertPathValidator</code> uses these parameters to
- * validate a <code>CertPath</code> according to the PKIX certification path
+ * A PKIX {@code CertPathValidator} uses these parameters to
+ * validate a {@code CertPath} according to the PKIX certification path
* validation algorithm.
*
- * <p>To instantiate a <code>PKIXParameters</code> object, an
+ * <p>To instantiate a {@code PKIXParameters} object, an
* application must specify one or more <i>most-trusted CAs</i> as defined by
* the PKIX certification path validation algorithm. The most-trusted CAs
* can be specified using one of two constructors. An application
* can call {@link #PKIXParameters(Set) PKIXParameters(Set)},
- * specifying a <code>Set</code> of <code>TrustAnchor</code> objects, each
+ * specifying a {@code Set} of {@code TrustAnchor} objects, each
* of which identify a most-trusted CA. Alternatively, an application can call
* {@link #PKIXParameters(KeyStore) PKIXParameters(KeyStore)}, specifying a
- * <code>KeyStore</code> instance containing trusted certificate entries, each
+ * {@code KeyStore} instance containing trusted certificate entries, each
* of which will be considered as a most-trusted CA.
* <p>
- * Once a <code>PKIXParameters</code> object has been created, other parameters
+ * Once a {@code PKIXParameters} object has been created, other parameters
* can be specified (by calling {@link #setInitialPolicies setInitialPolicies}
* or {@link #setDate setDate}, for instance) and then the
- * <code>PKIXParameters</code> is passed along with the <code>CertPath</code>
+ * {@code PKIXParameters} is passed along with the {@code CertPath}
* to be validated to {@link CertPathValidator#validate
* CertPathValidator.validate}.
* <p>
- * Any parameter that is not set (or is set to <code>null</code>) will
+ * Any parameter that is not set (or is set to {@code null}) will
* be set to the default value for that parameter. The default value for the
- * <code>date</code> parameter is <code>null</code>, which indicates
+ * {@code date} parameter is {@code null}, which indicates
* the current time when the path is validated. The default for the
* remaining parameters is the least constrained.
* <p>
@@ -99,20 +99,20 @@
private CertSelector certSelector;
/**
- * Creates an instance of <code>PKIXParameters</code> with the specified
- * <code>Set</code> of most-trusted CAs. Each element of the
+ * Creates an instance of {@code PKIXParameters} with the specified
+ * {@code Set} of most-trusted CAs. Each element of the
* set is a {@link TrustAnchor TrustAnchor}.
* <p>
- * Note that the <code>Set</code> is copied to protect against
+ * Note that the {@code Set} is copied to protect against
* subsequent modifications.
*
- * @param trustAnchors a <code>Set</code> of <code>TrustAnchor</code>s
+ * @param trustAnchors a {@code Set} of {@code TrustAnchor}s
* @throws InvalidAlgorithmParameterException if the specified
- * <code>Set</code> is empty <code>(trustAnchors.isEmpty() == true)</code>
- * @throws NullPointerException if the specified <code>Set</code> is
- * <code>null</code>
- * @throws ClassCastException if any of the elements in the <code>Set</code>
- * are not of type <code>java.security.cert.TrustAnchor</code>
+ * {@code Set} is empty {@code (trustAnchors.isEmpty() == true)}
+ * @throws NullPointerException if the specified {@code Set} is
+ * {@code null}
+ * @throws ClassCastException if any of the elements in the {@code Set}
+ * are not of type {@code java.security.cert.TrustAnchor}
*/
public PKIXParameters(Set<TrustAnchor> trustAnchors)
throws InvalidAlgorithmParameterException
@@ -125,18 +125,18 @@
}
/**
- * Creates an instance of <code>PKIXParameters</code> that
+ * Creates an instance of {@code PKIXParameters} that
* populates the set of most-trusted CAs from the trusted
- * certificate entries contained in the specified <code>KeyStore</code>.
- * Only keystore entries that contain trusted <code>X509Certificates</code>
+ * certificate entries contained in the specified {@code KeyStore}.
+ * Only keystore entries that contain trusted {@code X509Certificates}
* are considered; all other certificate types are ignored.
*
- * @param keystore a <code>KeyStore</code> from which the set of
+ * @param keystore a {@code KeyStore} from which the set of
* most-trusted CAs will be populated
* @throws KeyStoreException if the keystore has not been initialized
* @throws InvalidAlgorithmParameterException if the keystore does
* not contain at least one trusted certificate entry
- * @throws NullPointerException if the keystore is <code>null</code>
+ * @throws NullPointerException if the keystore is {@code null}
*/
public PKIXParameters(KeyStore keystore)
throws KeyStoreException, InvalidAlgorithmParameterException
@@ -161,11 +161,11 @@
}
/**
- * Returns an immutable <code>Set</code> of the most-trusted
+ * Returns an immutable {@code Set} of the most-trusted
* CAs.
*
- * @return an immutable <code>Set</code> of <code>TrustAnchor</code>s
- * (never <code>null</code>)
+ * @return an immutable {@code Set} of {@code TrustAnchor}s
+ * (never {@code null})
*
* @see #setTrustAnchors
*/
@@ -174,18 +174,18 @@
}
/**
- * Sets the <code>Set</code> of most-trusted CAs.
+ * Sets the {@code Set} of most-trusted CAs.
* <p>
- * Note that the <code>Set</code> is copied to protect against
+ * Note that the {@code Set} is copied to protect against
* subsequent modifications.
*
- * @param trustAnchors a <code>Set</code> of <code>TrustAnchor</code>s
+ * @param trustAnchors a {@code Set} of {@code TrustAnchor}s
* @throws InvalidAlgorithmParameterException if the specified
- * <code>Set</code> is empty <code>(trustAnchors.isEmpty() == true)</code>
- * @throws NullPointerException if the specified <code>Set</code> is
- * <code>null</code>
+ * {@code Set} is empty {@code (trustAnchors.isEmpty() == true)}
+ * @throws NullPointerException if the specified {@code Set} is
+ * {@code null}
* @throws ClassCastException if any of the elements in the set
- * are not of type <code>java.security.cert.TrustAnchor</code>
+ * are not of type {@code java.security.cert.TrustAnchor}
*
* @see #getTrustAnchors
*/
@@ -211,16 +211,16 @@
}
/**
- * Returns an immutable <code>Set</code> of initial
+ * Returns an immutable {@code Set} of initial
* policy identifiers (OID strings), indicating that any one of these
* policies would be acceptable to the certificate user for the purposes of
* certification path processing. The default return value is an empty
- * <code>Set</code>, which is interpreted as meaning that any policy would
+ * {@code Set}, which is interpreted as meaning that any policy would
* be acceptable.
*
- * @return an immutable <code>Set</code> of initial policy OIDs in
- * <code>String</code> format, or an empty <code>Set</code> (implying any
- * policy is acceptable). Never returns <code>null</code>.
+ * @return an immutable {@code Set} of initial policy OIDs in
+ * {@code String} format, or an empty {@code Set} (implying any
+ * policy is acceptable). Never returns {@code null}.
*
* @see #setInitialPolicies
*/
@@ -229,21 +229,21 @@
}
/**
- * Sets the <code>Set</code> of initial policy identifiers
+ * Sets the {@code Set} of initial policy identifiers
* (OID strings), indicating that any one of these
* policies would be acceptable to the certificate user for the purposes of
* certification path processing. By default, any policy is acceptable
* (i.e. all policies), so a user that wants to allow any policy as
* acceptable does not need to call this method, or can call it
- * with an empty <code>Set</code> (or <code>null</code>).
+ * with an empty {@code Set} (or {@code null}).
* <p>
- * Note that the <code>Set</code> is copied to protect against
+ * Note that the {@code Set} is copied to protect against
* subsequent modifications.
*
- * @param initialPolicies a <code>Set</code> of initial policy
- * OIDs in <code>String</code> format (or <code>null</code>)
+ * @param initialPolicies a {@code Set} of initial policy
+ * OIDs in {@code String} format (or {@code null})
* @throws ClassCastException if any of the elements in the set are
- * not of type <code>String</code>
+ * not of type {@code String}
*
* @see #getInitialPolicies
*/
@@ -262,19 +262,19 @@
}
/**
- * Sets the list of <code>CertStore</code>s to be used in finding
- * certificates and CRLs. May be <code>null</code>, in which case
- * no <code>CertStore</code>s will be used. The first
- * <code>CertStore</code>s in the list may be preferred to those that
+ * Sets the list of {@code CertStore}s to be used in finding
+ * certificates and CRLs. May be {@code null}, in which case
+ * no {@code CertStore}s will be used. The first
+ * {@code CertStore}s in the list may be preferred to those that
* appear later.
* <p>
- * Note that the <code>List</code> is copied to protect against
+ * Note that the {@code List} is copied to protect against
* subsequent modifications.
*
- * @param stores a <code>List</code> of <code>CertStore</code>s (or
- * <code>null</code>)
+ * @param stores a {@code List} of {@code CertStore}s (or
+ * {@code null})
* @throws ClassCastException if any of the elements in the list are
- * not of type <code>java.security.cert.CertStore</code>
+ * not of type {@code java.security.cert.CertStore}
*
* @see #getCertStores
*/
@@ -293,10 +293,10 @@
}
/**
- * Adds a <code>CertStore</code> to the end of the list of
- * <code>CertStore</code>s used in finding certificates and CRLs.
+ * Adds a {@code CertStore} to the end of the list of
+ * {@code CertStore}s used in finding certificates and CRLs.
*
- * @param store the <code>CertStore</code> to add. If <code>null</code>,
+ * @param store the {@code CertStore} to add. If {@code null},
* the store is ignored (not added to list).
*/
public void addCertStore(CertStore store) {
@@ -306,11 +306,11 @@
}
/**
- * Returns an immutable <code>List</code> of <code>CertStore</code>s that
+ * Returns an immutable {@code List} of {@code CertStore}s that
* are used to find certificates and CRLs.
*
- * @return an immutable <code>List</code> of <code>CertStore</code>s
- * (may be empty, but never <code>null</code>)
+ * @return an immutable {@code List} of {@code CertStore}s
+ * (may be empty, but never {@code null})
*
* @see #setCertStores
*/
@@ -325,7 +325,7 @@
* will be used. If this flag is false, the default revocation checking
* mechanism will be disabled (not used).
* <p>
- * When a <code>PKIXParameters</code> object is created, this flag is set
+ * When a {@code PKIXParameters} object is created, this flag is set
* to true. This setting reflects the most common strategy for checking
* revocation, since each service provider must support revocation
* checking to be PKIX compliant. Sophisticated applications should set
@@ -360,8 +360,8 @@
* acceptable policy needs to be explicitly identified in every certificate.
* By default, the ExplicitPolicyRequired flag is false.
*
- * @param val <code>true</code> if explicit policy is to be required,
- * <code>false</code> otherwise
+ * @param val {@code true} if explicit policy is to be required,
+ * {@code false} otherwise
*/
public void setExplicitPolicyRequired(boolean val) {
explicitPolicyRequired = val;
@@ -372,8 +372,8 @@
* acceptable policy needs to be explicitly identified in every certificate.
* By default, the ExplicitPolicyRequired flag is false.
*
- * @return <code>true</code> if explicit policy is required,
- * <code>false</code> otherwise
+ * @return {@code true} if explicit policy is required,
+ * {@code false} otherwise
*/
public boolean isExplicitPolicyRequired() {
return explicitPolicyRequired;
@@ -384,8 +384,8 @@
* mapping is inhibited. By default, policy mapping is not inhibited (the
* flag is false).
*
- * @param val <code>true</code> if policy mapping is to be inhibited,
- * <code>false</code> otherwise
+ * @param val {@code true} if policy mapping is to be inhibited,
+ * {@code false} otherwise
*/
public void setPolicyMappingInhibited(boolean val) {
policyMappingInhibited = val;
@@ -406,10 +406,10 @@
* Sets state to determine if the any policy OID should be processed
* if it is included in a certificate. By default, the any policy OID
* is not inhibited ({@link #isAnyPolicyInhibited isAnyPolicyInhibited()}
- * returns <code>false</code>).
+ * returns {@code false}).
*
- * @param val <code>true</code> if the any policy OID is to be
- * inhibited, <code>false</code> otherwise
+ * @param val {@code true} if the any policy OID is to be
+ * inhibited, {@code false} otherwise
*/
public void setAnyPolicyInhibited(boolean val) {
anyPolicyInhibited = val;
@@ -419,8 +419,8 @@
* Checks whether the any policy OID should be processed if it
* is included in a certificate.
*
- * @return <code>true</code> if the any policy OID is inhibited,
- * <code>false</code> otherwise
+ * @return {@code true} if the any policy OID is inhibited,
+ * {@code false} otherwise
*/
public boolean isAnyPolicyInhibited() {
return anyPolicyInhibited;
@@ -432,7 +432,7 @@
* policies extension that is marked critical are rejected.
* If the flag is false, certificates are not rejected on this basis.
*
- * <p> When a <code>PKIXParameters</code> object is created, this flag is
+ * <p> When a {@code PKIXParameters} object is created, this flag is
* set to true. This setting reflects the most common (and simplest)
* strategy for processing policy qualifiers. Applications that want to use
* a more sophisticated policy must set this flag to false.
@@ -459,7 +459,7 @@
* extension that is marked critical are rejected.
* If the flag is false, certificates are not rejected on this basis.
*
- * <p> When a <code>PKIXParameters</code> object is created, this flag is
+ * <p> When a {@code PKIXParameters} object is created, this flag is
* set to true. This setting reflects the most common (and simplest)
* strategy for processing policy qualifiers. Applications that want to use
* a more sophisticated policy must set this flag to false.
@@ -473,12 +473,12 @@
/**
* Returns the time for which the validity of the certification path
- * should be determined. If <code>null</code>, the current time is used.
+ * should be determined. If {@code null}, the current time is used.
* <p>
- * Note that the <code>Date</code> returned is copied to protect against
+ * Note that the {@code Date} returned is copied to protect against
* subsequent modifications.
*
- * @return the <code>Date</code>, or <code>null</code> if not set
+ * @return the {@code Date}, or {@code null} if not set
* @see #setDate
*/
public Date getDate() {
@@ -490,12 +490,12 @@
/**
* Sets the time for which the validity of the certification path
- * should be determined. If <code>null</code>, the current time is used.
+ * should be determined. If {@code null}, the current time is used.
* <p>
- * Note that the <code>Date</code> supplied here is copied to protect
+ * Note that the {@code Date} supplied here is copied to protect
* against subsequent modifications.
*
- * @param date the <code>Date</code>, or <code>null</code> for the
+ * @param date the {@code Date}, or {@code null} for the
* current time
* @see #getDate
*/
@@ -507,39 +507,39 @@
}
/**
- * Sets a <code>List</code> of additional certification path checkers. If
- * the specified <code>List</code> contains an object that is not a
- * <code>PKIXCertPathChecker</code>, it is ignored.
+ * Sets a {@code List} of additional certification path checkers. If
+ * the specified {@code List} contains an object that is not a
+ * {@code PKIXCertPathChecker}, it is ignored.
* <p>
- * Each <code>PKIXCertPathChecker</code> specified implements
+ * Each {@code PKIXCertPathChecker} specified implements
* additional checks on a certificate. Typically, these are checks to
* process and verify private extensions contained in certificates.
- * Each <code>PKIXCertPathChecker</code> should be instantiated with any
+ * Each {@code PKIXCertPathChecker} should be instantiated with any
* initialization parameters needed to execute the check.
* <p>
* This method allows sophisticated applications to extend a PKIX
- * <code>CertPathValidator</code> or <code>CertPathBuilder</code>.
- * Each of the specified <code>PKIXCertPathChecker</code>s will be called,
- * in turn, by a PKIX <code>CertPathValidator</code> or
- * <code>CertPathBuilder</code> for each certificate processed or
+ * {@code CertPathValidator} or {@code CertPathBuilder}.
+ * Each of the specified {@code PKIXCertPathChecker}s will be called,
+ * in turn, by a PKIX {@code CertPathValidator} or
+ * {@code CertPathBuilder} for each certificate processed or
* validated.
* <p>
- * Regardless of whether these additional <code>PKIXCertPathChecker</code>s
- * are set, a PKIX <code>CertPathValidator</code> or
- * <code>CertPathBuilder</code> must perform all of the required PKIX
+ * Regardless of whether these additional {@code PKIXCertPathChecker}s
+ * are set, a PKIX {@code CertPathValidator} or
+ * {@code CertPathBuilder} must perform all of the required PKIX
* checks on each certificate. The one exception to this rule is if the
* RevocationEnabled flag is set to false (see the {@link
* #setRevocationEnabled setRevocationEnabled} method).
* <p>
- * Note that the <code>List</code> supplied here is copied and each
- * <code>PKIXCertPathChecker</code> in the list is cloned to protect
+ * Note that the {@code List} supplied here is copied and each
+ * {@code PKIXCertPathChecker} in the list is cloned to protect
* against subsequent modifications.
*
- * @param checkers a <code>List</code> of <code>PKIXCertPathChecker</code>s.
- * May be <code>null</code>, in which case no additional checkers will be
+ * @param checkers a {@code List} of {@code PKIXCertPathChecker}s.
+ * May be {@code null}, in which case no additional checkers will be
* used.
* @throws ClassCastException if any of the elements in the list
- * are not of type <code>java.security.cert.PKIXCertPathChecker</code>
+ * are not of type {@code java.security.cert.PKIXCertPathChecker}
* @see #getCertPathCheckers
*/
public void setCertPathCheckers(List<PKIXCertPathChecker> checkers) {
@@ -556,14 +556,14 @@
}
/**
- * Returns the <code>List</code> of certification path checkers.
- * The returned <code>List</code> is immutable, and each
- * <code>PKIXCertPathChecker</code> in the <code>List</code> is cloned
+ * Returns the {@code List} of certification path checkers.
+ * The returned {@code List} is immutable, and each
+ * {@code PKIXCertPathChecker} in the {@code List} is cloned
* to protect against subsequent modifications.
*
- * @return an immutable <code>List</code> of
- * <code>PKIXCertPathChecker</code>s (may be empty, but not
- * <code>null</code>)
+ * @return an immutable {@code List} of
+ * {@code PKIXCertPathChecker}s (may be empty, but not
+ * {@code null})
* @see #setCertPathCheckers
*/
public List<PKIXCertPathChecker> getCertPathCheckers() {
@@ -575,15 +575,15 @@
}
/**
- * Adds a <code>PKIXCertPathChecker</code> to the list of certification
+ * Adds a {@code PKIXCertPathChecker} to the list of certification
* path checkers. See the {@link #setCertPathCheckers setCertPathCheckers}
* method for more details.
* <p>
- * Note that the <code>PKIXCertPathChecker</code> is cloned to protect
+ * Note that the {@code PKIXCertPathChecker} is cloned to protect
* against subsequent modifications.
*
- * @param checker a <code>PKIXCertPathChecker</code> to add to the list of
- * checks. If <code>null</code>, the checker is ignored (not added to list).
+ * @param checker a {@code PKIXCertPathChecker} to add to the list of
+ * checks. If {@code null}, the checker is ignored (not added to list).
*/
public void addCertPathChecker(PKIXCertPathChecker checker) {
if (checker != null) {
@@ -592,10 +592,10 @@
}
/**
- * Returns the signature provider's name, or <code>null</code>
+ * Returns the signature provider's name, or {@code null}
* if not set.
*
- * @return the signature provider's name (or <code>null</code>)
+ * @return the signature provider's name (or {@code null})
* @see #setSigProvider
*/
public String getSigProvider() {
@@ -605,10 +605,10 @@
/**
* Sets the signature provider's name. The specified provider will be
* preferred when creating {@link java.security.Signature Signature}
- * objects. If <code>null</code> or not set, the first provider found
+ * objects. If {@code null} or not set, the first provider found
* supporting the algorithm will be used.
*
- * @param sigProvider the signature provider's name (or <code>null</code>)
+ * @param sigProvider the signature provider's name (or {@code null})
* @see #getSigProvider
*/
public void setSigProvider(String sigProvider) {
@@ -617,14 +617,14 @@
/**
* Returns the required constraints on the target certificate.
- * The constraints are returned as an instance of <code>CertSelector</code>.
- * If <code>null</code>, no constraints are defined.
+ * The constraints are returned as an instance of {@code CertSelector}.
+ * If {@code null}, no constraints are defined.
*
- * <p>Note that the <code>CertSelector</code> returned is cloned
+ * <p>Note that the {@code CertSelector} returned is cloned
* to protect against subsequent modifications.
*
- * @return a <code>CertSelector</code> specifying the constraints
- * on the target certificate (or <code>null</code>)
+ * @return a {@code CertSelector} specifying the constraints
+ * on the target certificate (or {@code null})
* @see #setTargetCertConstraints
*/
public CertSelector getTargetCertConstraints() {
@@ -638,14 +638,14 @@
/**
* Sets the required constraints on the target certificate.
* The constraints are specified as an instance of
- * <code>CertSelector</code>. If <code>null</code>, no constraints are
+ * {@code CertSelector}. If {@code null}, no constraints are
* defined.
*
- * <p>Note that the <code>CertSelector</code> specified is cloned
+ * <p>Note that the {@code CertSelector} specified is cloned
* to protect against subsequent modifications.
*
- * @param selector a <code>CertSelector</code> specifying the constraints
- * on the target certificate (or <code>null</code>)
+ * @param selector a {@code CertSelector} specifying the constraints
+ * on the target certificate (or {@code null})
* @see #getTargetCertConstraints
*/
public void setTargetCertConstraints(CertSelector selector) {
@@ -656,10 +656,10 @@
}
/**
- * Makes a copy of this <code>PKIXParameters</code> object. Changes
+ * Makes a copy of this {@code PKIXParameters} object. Changes
* to the copy will not affect the original and vice versa.
*
- * @return a copy of this <code>PKIXParameters</code> object
+ * @return a copy of this {@code PKIXParameters} object
*/
public Object clone() {
try {
@@ -683,7 +683,7 @@
return copy;
} catch (CloneNotSupportedException e) {
/* Cannot happen */
- throw new InternalError(e.toString());
+ throw new InternalError(e.toString(), e);
}
}
diff --git a/ojluni/src/main/java/java/security/cert/PKIXReason.java b/ojluni/src/main/java/java/security/cert/PKIXReason.java
index 9d81b13..d58ded9 100644
--- a/ojluni/src/main/java/java/security/cert/PKIXReason.java
+++ b/ojluni/src/main/java/java/security/cert/PKIXReason.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -26,10 +26,10 @@
package java.security.cert;
/**
- * The <code>PKIXReason</code> enumerates the potential PKIX-specific reasons
+ * The {@code PKIXReason} enumerates the potential PKIX-specific reasons
* that an X.509 certification path may be invalid according to the PKIX
* (RFC 3280) standard. These reasons are in addition to those of the
- * <code>CertPathValidatorException.BasicReason</code> enumeration.
+ * {@code CertPathValidatorException.BasicReason} enumeration.
*
* @since 1.7
*/
diff --git a/ojluni/src/main/java/java/security/cert/PolicyNode.java b/ojluni/src/main/java/java/security/cert/PolicyNode.java
index 7b16dfe..1633dcb 100644
--- a/ojluni/src/main/java/java/security/cert/PolicyNode.java
+++ b/ojluni/src/main/java/java/security/cert/PolicyNode.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -41,7 +41,7 @@
*
* <p>Most applications will not need to examine the valid policy tree.
* They can achieve their policy processing goals by setting the
- * policy-related parameters in <code>PKIXParameters</code>. However,
+ * policy-related parameters in {@code PKIXParameters}. However,
* the valid policy tree is available for more sophisticated applications,
* especially those that process policy qualifiers.
*
@@ -50,12 +50,12 @@
* valid policy tree. The tree can be traversed using the
* {@link #getChildren getChildren} and {@link #getParent getParent} methods.
* Data about a particular node can be retrieved using other methods of
- * <code>PolicyNode</code>.
+ * {@code PolicyNode}.
*
* <p><b>Concurrent Access</b>
- * <p>All <code>PolicyNode</code> objects must be immutable and
+ * <p>All {@code PolicyNode} objects must be immutable and
* thread-safe. Multiple threads may concurrently invoke the methods defined
- * in this class on a single <code>PolicyNode</code> object (or more than one)
+ * in this class on a single {@code PolicyNode} object (or more than one)
* with no ill effects. This stipulation applies to all public fields and
* methods of this class and any added or overridden by subclasses.
*
@@ -65,10 +65,10 @@
public interface PolicyNode {
/**
- * Returns the parent of this node, or <code>null</code> if this is the
+ * Returns the parent of this node, or {@code null} if this is the
* root node.
*
- * @return the parent of this node, or <code>null</code> if this is the
+ * @return the parent of this node, or {@code null} if this is the
* root node
*/
PolicyNode getParent();
@@ -76,8 +76,8 @@
/**
* Returns an iterator over the children of this node. Any attempts to
* modify the children of this node through the
- * <code>Iterator</code>'s remove method must throw an
- * <code>UnsupportedOperationException</code>.
+ * {@code Iterator}'s remove method must throw an
+ * {@code UnsupportedOperationException}.
*
* @return an iterator over the children of this node
*/
@@ -94,7 +94,7 @@
/**
* Returns the valid policy represented by this node.
*
- * @return the <code>String</code> OID of the valid policy
+ * @return the {@code String} OID of the valid policy
* represented by this node. For the root node, this method always returns
* the special anyPolicy OID: "2.5.29.32.0".
*/
@@ -104,9 +104,9 @@
* Returns the set of policy qualifiers associated with the
* valid policy represented by this node.
*
- * @return an immutable <code>Set</code> of
- * <code>PolicyQualifierInfo</code>s. For the root node, this
- * is always an empty <code>Set</code>.
+ * @return an immutable {@code Set} of
+ * {@code PolicyQualifierInfo}s. For the root node, this
+ * is always an empty {@code Set}.
*/
Set<? extends PolicyQualifierInfo> getPolicyQualifiers();
@@ -114,9 +114,9 @@
* Returns the set of expected policies that would satisfy this
* node's valid policy in the next certificate to be processed.
*
- * @return an immutable <code>Set</code> of expected policy
- * <code>String</code> OIDs. For the root node, this method
- * always returns a <code>Set</code> with one element, the
+ * @return an immutable {@code Set} of expected policy
+ * {@code String} OIDs. For the root node, this method
+ * always returns a {@code Set} with one element, the
* special anyPolicy OID: "2.5.29.32.0".
*/
Set<String> getExpectedPolicies();
@@ -125,8 +125,8 @@
* Returns the criticality indicator of the certificate policy extension
* in the most recently processed certificate.
*
- * @return <code>true</code> if extension marked critical,
- * <code>false</code> otherwise. For the root node, <code>false</code>
+ * @return {@code true} if extension marked critical,
+ * {@code false} otherwise. For the root node, {@code false}
* is always returned.
*/
boolean isCritical();
diff --git a/ojluni/src/main/java/java/security/cert/PolicyQualifierInfo.java b/ojluni/src/main/java/java/security/cert/PolicyQualifierInfo.java
index 75a8702..ec06a88 100644
--- a/ojluni/src/main/java/java/security/cert/PolicyQualifierInfo.java
+++ b/ojluni/src/main/java/java/security/cert/PolicyQualifierInfo.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@
* structure.
*
* <p>The ASN.1 definition is as follows:
- * <p><pre>
+ * <pre>
* PolicyQualifierInfo ::= SEQUENCE {
* policyQualifierId PolicyQualifierId,
* qualifier ANY DEFINED BY policyQualifierId }
@@ -50,12 +50,12 @@
* policy information terms limit the set of policies for certification paths
* which include this certificate.
* <p>
- * A <code>Set</code> of <code>PolicyQualifierInfo</code> objects are returned
+ * A {@code Set} of {@code PolicyQualifierInfo} objects are returned
* by the {@link PolicyNode#getPolicyQualifiers PolicyNode.getPolicyQualifiers}
* method. This allows applications with specific policy requirements to
* process and validate each policy qualifier. Applications that need to
* process policy qualifiers should explicitly set the
- * <code>policyQualifiersRejected</code> flag to false (by calling the
+ * {@code policyQualifiersRejected} flag to false (by calling the
* {@link PKIXParameters#setPolicyQualifiersRejected
* PKIXParameters.setPolicyQualifiersRejected} method) before validating
* a certification path.
@@ -64,17 +64,17 @@
* that any policy qualifier in a certificate policies extension that is
* marked critical must be processed and validated. Otherwise the
* certification path must be rejected. If the
- * <code>policyQualifiersRejected</code> flag is set to false, it is up to
+ * {@code policyQualifiersRejected} flag is set to false, it is up to
* the application to validate all policy qualifiers in this manner in order
* to be PKIX compliant.
*
* <p><b>Concurrent Access</b>
*
- * <p>All <code>PolicyQualifierInfo</code> objects must be immutable and
+ * <p>All {@code PolicyQualifierInfo} objects must be immutable and
* thread-safe. That is, multiple threads may concurrently invoke the
- * methods defined in this class on a single <code>PolicyQualifierInfo</code>
+ * methods defined in this class on a single {@code PolicyQualifierInfo}
* object (or more than one) with no ill effects. Requiring
- * <code>PolicyQualifierInfo</code> objects to be immutable and thread-safe
+ * {@code PolicyQualifierInfo} objects to be immutable and thread-safe
* allows them to be passed around to various pieces of code without
* worrying about coordinating access.
*
@@ -90,7 +90,7 @@
private String pqiString;
/**
- * Creates an instance of <code>PolicyQualifierInfo</code> from the
+ * Creates an instance of {@code PolicyQualifierInfo} from the
* encoded bytes. The encoded byte array is copied on construction.
*
* @param encoded a byte array containing the qualifier in DER encoding
@@ -115,12 +115,12 @@
}
/**
- * Returns the <code>policyQualifierId</code> field of this
- * <code>PolicyQualifierInfo</code>. The <code>policyQualifierId</code>
+ * Returns the {@code policyQualifierId} field of this
+ * {@code PolicyQualifierInfo}. The {@code policyQualifierId}
* is an Object Identifier (OID) represented by a set of nonnegative
* integers separated by periods.
*
- * @return the OID (never <code>null</code>)
+ * @return the OID (never {@code null})
*/
public final String getPolicyQualifierId() {
return mId;
@@ -128,9 +128,9 @@
/**
* Returns the ASN.1 DER encoded form of this
- * <code>PolicyQualifierInfo</code>.
+ * {@code PolicyQualifierInfo}.
*
- * @return the ASN.1 DER encoded bytes (never <code>null</code>).
+ * @return the ASN.1 DER encoded bytes (never {@code null}).
* Note that a copy is returned, so the data is cloned each time
* this method is called.
*/
@@ -139,10 +139,10 @@
}
/**
- * Returns the ASN.1 DER encoded form of the <code>qualifier</code>
- * field of this <code>PolicyQualifierInfo</code>.
+ * Returns the ASN.1 DER encoded form of the {@code qualifier}
+ * field of this {@code PolicyQualifierInfo}.
*
- * @return the ASN.1 DER encoded bytes of the <code>qualifier</code>
+ * @return the ASN.1 DER encoded bytes of the {@code qualifier}
* field. Note that a copy is returned, so the data is cloned each
* time this method is called.
*/
@@ -152,10 +152,10 @@
/**
* Return a printable representation of this
- * <code>PolicyQualifierInfo</code>.
+ * {@code PolicyQualifierInfo}.
*
- * @return a <code>String</code> describing the contents of this
- * <code>PolicyQualifierInfo</code>
+ * @return a {@code String} describing the contents of this
+ * {@code PolicyQualifierInfo}
*/
public String toString() {
if (pqiString != null)
diff --git a/ojluni/src/main/java/java/security/cert/TrustAnchor.java b/ojluni/src/main/java/java/security/cert/TrustAnchor.java
index d9c88f4..c98bf81 100644
--- a/ojluni/src/main/java/java/security/cert/TrustAnchor.java
+++ b/ojluni/src/main/java/java/security/cert/TrustAnchor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -40,16 +40,15 @@
* for validating X.509 certification paths. A most-trusted CA includes the
* public key of the CA, the CA's name, and any constraints upon the set of
* paths which may be validated using this key. These parameters can be
- * specified in the form of a trusted <code>X509Certificate</code> or as
+ * specified in the form of a trusted {@code X509Certificate} or as
* individual parameters.
* <p>
* <b>Concurrent Access</b>
- * <p>
- * <p>All <code>TrustAnchor</code> objects must be immutable and
+ * <p>All {@code TrustAnchor} objects must be immutable and
* thread-safe. That is, multiple threads may concurrently invoke the
- * methods defined in this class on a single <code>TrustAnchor</code>
+ * methods defined in this class on a single {@code TrustAnchor}
* object (or more than one) with no ill effects. Requiring
- * <code>TrustAnchor</code> objects to be immutable and thread-safe
+ * {@code TrustAnchor} objects to be immutable and thread-safe
* allows them to be passed around to various pieces of code without
* worrying about coordinating access. This stipulation applies to all
* public fields and methods of this class and any added or overridden
@@ -71,8 +70,8 @@
private NameConstraintsExtension nc;
/**
- * Creates an instance of <code>TrustAnchor</code> with the specified
- * <code>X509Certificate</code> and optional name constraints, which
+ * Creates an instance of {@code TrustAnchor} with the specified
+ * {@code X509Certificate} and optional name constraints, which
* are intended to be used as additional constraints when validating
* an X.509 certification path.
* <p>
@@ -82,7 +81,7 @@
* <a href="http://www.ietf.org/rfc/rfc3280">RFC 3280</a>
* and X.509. The ASN.1 definition of this structure appears below.
*
- * <pre><code>
+ * <pre>{@code
* NameConstraints ::= SEQUENCE {
* permittedSubtrees [0] GeneralSubtrees OPTIONAL,
* excludedSubtrees [1] GeneralSubtrees OPTIONAL }
@@ -106,20 +105,20 @@
* uniformResourceIdentifier [6] IA5String,
* iPAddress [7] OCTET STRING,
* registeredID [8] OBJECT IDENTIFIER}
- * </code></pre>
+ * }</pre>
* <p>
* Note that the name constraints byte array supplied is cloned to protect
* against subsequent modifications.
*
- * @param trustedCert a trusted <code>X509Certificate</code>
+ * @param trustedCert a trusted {@code X509Certificate}
* @param nameConstraints a byte array containing the ASN.1 DER encoding of
* a NameConstraints extension to be used for checking name constraints.
* Only the value of the extension is included, not the OID or criticality
- * flag. Specify <code>null</code> to omit the parameter.
+ * flag. Specify {@code null} to omit the parameter.
* @throws IllegalArgumentException if the name constraints cannot be
* decoded
* @throws NullPointerException if the specified
- * <code>X509Certificate</code> is <code>null</code>
+ * {@code X509Certificate} is {@code null}
*/
public TrustAnchor(X509Certificate trustedCert, byte[] nameConstraints)
{
@@ -134,7 +133,7 @@
}
/**
- * Creates an instance of <code>TrustAnchor</code> where the
+ * Creates an instance of {@code TrustAnchor} where the
* most-trusted CA is specified as an X500Principal and public key.
* Name constraints are an optional parameter, and are intended to be used
* as additional constraints when validating an X.509 certification path.
@@ -155,9 +154,9 @@
* @param nameConstraints a byte array containing the ASN.1 DER encoding of
* a NameConstraints extension to be used for checking name constraints.
* Only the value of the extension is included, not the OID or criticality
- * flag. Specify <code>null</code> to omit the parameter.
- * @throws NullPointerException if the specified <code>caPrincipal</code> or
- * <code>pubKey</code> parameter is <code>null</code>
+ * flag. Specify {@code null} to omit the parameter.
+ * @throws NullPointerException if the specified {@code caPrincipal} or
+ * {@code pubKey} parameter is {@code null}
* @since 1.5
*/
public TrustAnchor(X500Principal caPrincipal, PublicKey pubKey,
@@ -173,7 +172,7 @@
}
/**
- * Creates an instance of <code>TrustAnchor</code> where the
+ * Creates an instance of {@code TrustAnchor} where the
* most-trusted CA is specified as a distinguished name and public key.
* Name constraints are an optional parameter, and are intended to be used
* as additional constraints when validating an X.509 certification path.
@@ -191,17 +190,17 @@
*
* @param caName the X.500 distinguished name of the most-trusted CA in
* <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253</a>
- * <code>String</code> format
+ * {@code String} format
* @param pubKey the public key of the most-trusted CA
* @param nameConstraints a byte array containing the ASN.1 DER encoding of
* a NameConstraints extension to be used for checking name constraints.
* Only the value of the extension is included, not the OID or criticality
- * flag. Specify <code>null</code> to omit the parameter.
- * @throws IllegalArgumentException if the specified <code>
- * caName</code> parameter is empty <code>(caName.length() == 0)</code>
+ * flag. Specify {@code null} to omit the parameter.
+ * @throws IllegalArgumentException if the specified
+ * {@code caName} parameter is empty {@code (caName.length() == 0)}
* or incorrectly formatted or the name constraints cannot be decoded
- * @throws NullPointerException if the specified <code>caName</code> or
- * <code>pubKey</code> parameter is <code>null</code>
+ * @throws NullPointerException if the specified {@code caName} or
+ * {@code pubKey} parameter is {@code null}
*/
public TrustAnchor(String caName, PublicKey pubKey, byte[] nameConstraints)
{
@@ -225,7 +224,7 @@
/**
* Returns the most-trusted CA certificate.
*
- * @return a trusted <code>X509Certificate</code> or <code>null</code>
+ * @return a trusted {@code X509Certificate} or {@code null}
* if the trust anchor was not specified as a trusted certificate
*/
public final X509Certificate getTrustedCert() {
@@ -236,7 +235,7 @@
* Returns the name of the most-trusted CA as an X500Principal.
*
* @return the X.500 distinguished name of the most-trusted CA, or
- * <code>null</code> if the trust anchor was not specified as a trusted
+ * {@code null} if the trust anchor was not specified as a trusted
* public key and name or X500Principal pair
* @since 1.5
*/
@@ -245,11 +244,11 @@
}
/**
- * Returns the name of the most-trusted CA in RFC 2253 <code>String</code>
+ * Returns the name of the most-trusted CA in RFC 2253 {@code String}
* format.
*
* @return the X.500 distinguished name of the most-trusted CA, or
- * <code>null</code> if the trust anchor was not specified as a trusted
+ * {@code null} if the trust anchor was not specified as a trusted
* public key and name or X500Principal pair
*/
public final String getCAName() {
@@ -259,7 +258,7 @@
/**
* Returns the public key of the most-trusted CA.
*
- * @return the public key of the most-trusted CA, or <code>null</code>
+ * @return the public key of the most-trusted CA, or {@code null}
* if the trust anchor was not specified as a trusted public key and name
* or X500Principal pair
*/
@@ -306,16 +305,16 @@
*
* @return a byte array containing the ASN.1 DER encoding of
* a NameConstraints extension used for checking name constraints,
- * or <code>null</code> if not set.
+ * or {@code null} if not set.
*/
public final byte [] getNameConstraints() {
return ncBytes == null ? null : ncBytes.clone();
}
/**
- * Returns a formatted string describing the <code>TrustAnchor</code>.
+ * Returns a formatted string describing the {@code TrustAnchor}.
*
- * @return a formatted string describing the <code>TrustAnchor</code>
+ * @return a formatted string describing the {@code TrustAnchor}
*/
public String toString() {
StringBuffer sb = new StringBuffer();
diff --git a/ojluni/src/main/java/java/security/cert/X509CRLEntry.java b/ojluni/src/main/java/java/security/cert/X509CRLEntry.java
index 517bbd2..268fa81 100644
--- a/ojluni/src/main/java/java/security/cert/X509CRLEntry.java
+++ b/ojluni/src/main/java/java/security/cert/X509CRLEntry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -43,11 +43,11 @@
* crlEntryExtensions Extensions OPTIONAL
* -- if present, must be v2
* } OPTIONAL
- *<p>
+ *
* CertificateSerialNumber ::= INTEGER
- *<p>
+ *
* Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension
- *<p>
+ *
* Extension ::= SEQUENCE {
* extnId OBJECT IDENTIFIER,
* critical BOOLEAN DEFAULT FALSE,
@@ -68,8 +68,8 @@
/**
* Compares this CRL entry for equality with the given
- * object. If the <code>other</code> object is an
- * <code>instanceof</code> <code>X509CRLEntry</code>, then
+ * object. If the {@code other} object is an
+ * {@code instanceof} {@code X509CRLEntry}, then
* its encoded form (the inner SEQUENCE) is retrieved and compared
* with the encoded form of this CRL entry.
*
@@ -178,7 +178,7 @@
* in the Reason Code extension of this CRL entry.
*
* @return the reason the certificate has been revoked, or
- * <code>null</code> if this CRL entry does not have
+ * {@code null} if this CRL entry does not have
* a Reason Code extension
* @since 1.7
*/
diff --git a/ojluni/src/main/java/java/security/cert/X509CRLSelector.java b/ojluni/src/main/java/java/security/cert/X509CRLSelector.java
index 7e702d2..face5ff 100644
--- a/ojluni/src/main/java/java/security/cert/X509CRLSelector.java
+++ b/ojluni/src/main/java/java/security/cert/X509CRLSelector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -37,18 +37,18 @@
import sun.security.x509.X500Name;
/**
- * A <code>CRLSelector</code> that selects <code>X509CRLs</code> that
+ * A {@code CRLSelector} that selects {@code X509CRLs} that
* match all specified criteria. This class is particularly useful when
- * selecting CRLs from a <code>CertStore</code> to check revocation status
+ * selecting CRLs from a {@code CertStore} to check revocation status
* of a particular certificate.
* <p>
- * When first constructed, an <code>X509CRLSelector</code> has no criteria
- * enabled and each of the <code>get</code> methods return a default
- * value (<code>null</code>). Therefore, the {@link #match match} method
- * would return <code>true</code> for any <code>X509CRL</code>. Typically,
+ * When first constructed, an {@code X509CRLSelector} has no criteria
+ * enabled and each of the {@code get} methods return a default
+ * value ({@code null}). Therefore, the {@link #match match} method
+ * would return {@code true} for any {@code X509CRL}. Typically,
* several criteria are enabled (by calling {@link #setIssuers setIssuers}
* or {@link #setDateAndTime setDateAndTime}, for instance) and then the
- * <code>X509CRLSelector</code> is passed to
+ * {@code X509CRLSelector} is passed to
* {@link CertStore#getCRLs CertStore.getCRLs} or some similar
* method.
* <p>
@@ -86,35 +86,35 @@
private long skew = 0;
/**
- * Creates an <code>X509CRLSelector</code>. Initially, no criteria are set
- * so any <code>X509CRL</code> will match.
+ * Creates an {@code X509CRLSelector}. Initially, no criteria are set
+ * so any {@code X509CRL} will match.
*/
public X509CRLSelector() {}
/**
* Sets the issuerNames criterion. The issuer distinguished name in the
- * <code>X509CRL</code> must match at least one of the specified
- * distinguished names. If <code>null</code>, any issuer distinguished name
+ * {@code X509CRL} must match at least one of the specified
+ * distinguished names. If {@code null}, any issuer distinguished name
* will do.
* <p>
* This method allows the caller to specify, with a single method call,
- * the complete set of issuer names which <code>X509CRLs</code> may contain.
+ * the complete set of issuer names which {@code X509CRLs} may contain.
* The specified value replaces the previous value for the issuerNames
* criterion.
* <p>
- * The <code>names</code> parameter (if not <code>null</code>) is a
- * <code>Collection</code> of <code>X500Principal</code>s.
+ * The {@code names} parameter (if not {@code null}) is a
+ * {@code Collection} of {@code X500Principal}s.
* <p>
- * Note that the <code>names</code> parameter can contain duplicate
+ * Note that the {@code names} parameter can contain duplicate
* distinguished names, but they may be removed from the
- * <code>Collection</code> of names returned by the
+ * {@code Collection} of names returned by the
* {@link #getIssuers getIssuers} method.
* <p>
- * Note that a copy is performed on the <code>Collection</code> to
+ * Note that a copy is performed on the {@code Collection} to
* protect against subsequent modifications.
*
- * @param issuers a <code>Collection</code> of X500Principals
- * (or <code>null</code>)
+ * @param issuers a {@code Collection} of X500Principals
+ * (or {@code null})
* @see #getIssuers
* @since 1.5
*/
@@ -138,31 +138,31 @@
* this method. See {@link #addIssuerName(String)} for more information.
* <p>
* Sets the issuerNames criterion. The issuer distinguished name in the
- * <code>X509CRL</code> must match at least one of the specified
- * distinguished names. If <code>null</code>, any issuer distinguished name
+ * {@code X509CRL} must match at least one of the specified
+ * distinguished names. If {@code null}, any issuer distinguished name
* will do.
* <p>
* This method allows the caller to specify, with a single method call,
- * the complete set of issuer names which <code>X509CRLs</code> may contain.
+ * the complete set of issuer names which {@code X509CRLs} may contain.
* The specified value replaces the previous value for the issuerNames
* criterion.
* <p>
- * The <code>names</code> parameter (if not <code>null</code>) is a
- * <code>Collection</code> of names. Each name is a <code>String</code>
+ * The {@code names} parameter (if not {@code null}) is a
+ * {@code Collection} of names. Each name is a {@code String}
* or a byte array representing a distinguished name (in
* <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253</a> or
- * ASN.1 DER encoded form, respectively). If <code>null</code> is supplied
+ * ASN.1 DER encoded form, respectively). If {@code null} is supplied
* as the value for this argument, no issuerNames check will be performed.
* <p>
- * Note that the <code>names</code> parameter can contain duplicate
+ * Note that the {@code names} parameter can contain duplicate
* distinguished names, but they may be removed from the
- * <code>Collection</code> of names returned by the
+ * {@code Collection} of names returned by the
* {@link #getIssuerNames getIssuerNames} method.
* <p>
* If a name is specified as a byte array, it should contain a single DER
* encoded distinguished name, as defined in X.501. The ASN.1 notation for
* this structure is as follows.
- * <pre><code>
+ * <pre>{@code
* Name ::= CHOICE {
* RDNSequence }
*
@@ -185,12 +185,12 @@
* universalString UniversalString (SIZE (1..MAX)),
* utf8String UTF8String (SIZE (1.. MAX)),
* bmpString BMPString (SIZE (1..MAX)) }
- * </code></pre>
+ * }</pre>
* <p>
- * Note that a deep copy is performed on the <code>Collection</code> to
+ * Note that a deep copy is performed on the {@code Collection} to
* protect against subsequent modifications.
*
- * @param names a <code>Collection</code> of names (or <code>null</code>)
+ * @param names a {@code Collection} of names (or {@code null})
* @throws IOException if a parsing error occurs
* @see #getIssuerNames
*/
@@ -208,11 +208,11 @@
/**
* Adds a name to the issuerNames criterion. The issuer distinguished
- * name in the <code>X509CRL</code> must match at least one of the specified
+ * name in the {@code X509CRL} must match at least one of the specified
* distinguished names.
* <p>
* This method allows the caller to add a name to the set of issuer names
- * which <code>X509CRLs</code> may contain. The specified name is added to
+ * which {@code X509CRLs} may contain. The specified name is added to
* any previous value for the issuerNames criterion.
* If the specified name is a duplicate, it may be ignored.
*
@@ -232,11 +232,11 @@
* names.
* <p>
* Adds a name to the issuerNames criterion. The issuer distinguished
- * name in the <code>X509CRL</code> must match at least one of the specified
+ * name in the {@code X509CRL} must match at least one of the specified
* distinguished names.
* <p>
* This method allows the caller to add a name to the set of issuer names
- * which <code>X509CRLs</code> may contain. The specified name is added to
+ * which {@code X509CRLs} may contain. The specified name is added to
* any previous value for the issuerNames criterion.
* If the specified name is a duplicate, it may be ignored.
*
@@ -249,11 +249,11 @@
/**
* Adds a name to the issuerNames criterion. The issuer distinguished
- * name in the <code>X509CRL</code> must match at least one of the specified
+ * name in the {@code X509CRL} must match at least one of the specified
* distinguished names.
* <p>
* This method allows the caller to add a name to the set of issuer names
- * which <code>X509CRLs</code> may contain. The specified name is added to
+ * which {@code X509CRLs} may contain. The specified name is added to
* any previous value for the issuerNames criterion. If the specified name
* is a duplicate, it may be ignored.
* If a name is specified as a byte array, it should contain a single DER
@@ -279,7 +279,7 @@
/**
* A private method that adds a name (String or byte array) to the
* issuerNames criterion. The issuer distinguished
- * name in the <code>X509CRL</code> must match at least one of the specified
+ * name in the {@code X509CRL} must match at least one of the specified
* distinguished names.
*
* @param name the name in string or byte array form
@@ -301,11 +301,11 @@
* Clone and check an argument of the form passed to
* setIssuerNames. Throw an IOException if the argument is malformed.
*
- * @param names a <code>Collection</code> of names. Each entry is a
+ * @param names a {@code Collection} of names. Each entry is a
* String or a byte array (the name, in string or ASN.1
- * DER encoded form, respectively). <code>null</code> is
+ * DER encoded form, respectively). {@code null} is
* not an acceptable value.
- * @return a deep copy of the specified <code>Collection</code>
+ * @return a deep copy of the specified {@code Collection}
* @throws IOException if a parsing error occurs
*/
private static HashSet<Object> cloneAndCheckIssuerNames(Collection<?> names)
@@ -334,11 +334,11 @@
* into a RuntimeException. This method should be used when the object being
* cloned has already been checked, so there should never be any exceptions.
*
- * @param names a <code>Collection</code> of names. Each entry is a
+ * @param names a {@code Collection} of names. Each entry is a
* String or a byte array (the name, in string or ASN.1
- * DER encoded form, respectively). <code>null</code> is
+ * DER encoded form, respectively). {@code null} is
* not an acceptable value.
- * @return a deep copy of the specified <code>Collection</code>
+ * @return a deep copy of the specified {@code Collection}
* @throws RuntimeException if a parsing error occurs
*/
private static HashSet<Object> cloneIssuerNames(Collection<Object> names) {
@@ -354,7 +354,7 @@
* returning a Collection of issuerX500Principals.
* Throw an IOException if the argument is malformed.
*
- * @param names a <code>Collection</code> of names. Each entry is a
+ * @param names a {@code Collection} of names. Each entry is a
* String or a byte array (the name, in string or ASN.1
* DER encoded form, respectively). <Code>Null</Code> is
* not an acceptable value.
@@ -380,24 +380,24 @@
}
/**
- * Sets the minCRLNumber criterion. The <code>X509CRL</code> must have a
+ * Sets the minCRLNumber criterion. The {@code X509CRL} must have a
* CRL number extension whose value is greater than or equal to the
- * specified value. If <code>null</code>, no minCRLNumber check will be
+ * specified value. If {@code null}, no minCRLNumber check will be
* done.
*
- * @param minCRL the minimum CRL number accepted (or <code>null</code>)
+ * @param minCRL the minimum CRL number accepted (or {@code null})
*/
public void setMinCRLNumber(BigInteger minCRL) {
this.minCRL = minCRL;
}
/**
- * Sets the maxCRLNumber criterion. The <code>X509CRL</code> must have a
+ * Sets the maxCRLNumber criterion. The {@code X509CRL} must have a
* CRL number extension whose value is less than or equal to the
- * specified value. If <code>null</code>, no maxCRLNumber check will be
+ * specified value. If {@code null}, no maxCRLNumber check will be
* done.
*
- * @param maxCRL the maximum CRL number accepted (or <code>null</code>)
+ * @param maxCRL the maximum CRL number accepted (or {@code null})
*/
public void setMaxCRLNumber(BigInteger maxCRL) {
this.maxCRL = maxCRL;
@@ -406,16 +406,16 @@
/**
* Sets the dateAndTime criterion. The specified date must be
* equal to or later than the value of the thisUpdate component
- * of the <code>X509CRL</code> and earlier than the value of the
- * nextUpdate component. There is no match if the <code>X509CRL</code>
+ * of the {@code X509CRL} and earlier than the value of the
+ * nextUpdate component. There is no match if the {@code X509CRL}
* does not contain a nextUpdate component.
- * If <code>null</code>, no dateAndTime check will be done.
+ * If {@code null}, no dateAndTime check will be done.
* <p>
- * Note that the <code>Date</code> supplied here is cloned to protect
+ * Note that the {@code Date} supplied here is cloned to protect
* against subsequent modifications.
*
- * @param dateAndTime the <code>Date</code> to match against
- * (or <code>null</code>)
+ * @param dateAndTime the {@code Date} to match against
+ * (or {@code null})
* @see #getDateAndTime
*/
public void setDateAndTime(Date dateAndTime) {
@@ -438,13 +438,13 @@
/**
* Sets the certificate being checked. This is not a criterion. Rather,
- * it is optional information that may help a <code>CertStore</code>
+ * it is optional information that may help a {@code CertStore}
* find CRLs that would be relevant when checking revocation for the
- * specified certificate. If <code>null</code> is specified, then no
+ * specified certificate. If {@code null} is specified, then no
* such optional information is provided.
*
- * @param cert the <code>X509Certificate</code> being checked
- * (or <code>null</code>)
+ * @param cert the {@code X509Certificate} being checked
+ * (or {@code null})
* @see #getCertificateChecking
*/
public void setCertificateChecking(X509Certificate cert) {
@@ -453,15 +453,15 @@
/**
* Returns the issuerNames criterion. The issuer distinguished
- * name in the <code>X509CRL</code> must match at least one of the specified
- * distinguished names. If the value returned is <code>null</code>, any
+ * name in the {@code X509CRL} must match at least one of the specified
+ * distinguished names. If the value returned is {@code null}, any
* issuer distinguished name will do.
* <p>
- * If the value returned is not <code>null</code>, it is a
- * unmodifiable <code>Collection</code> of <code>X500Principal</code>s.
+ * If the value returned is not {@code null}, it is a
+ * unmodifiable {@code Collection} of {@code X500Principal}s.
*
- * @return an unmodifiable <code>Collection</code> of names
- * (or <code>null</code>)
+ * @return an unmodifiable {@code Collection} of names
+ * (or {@code null})
* @see #setIssuers
* @since 1.5
*/
@@ -474,25 +474,25 @@
/**
* Returns a copy of the issuerNames criterion. The issuer distinguished
- * name in the <code>X509CRL</code> must match at least one of the specified
- * distinguished names. If the value returned is <code>null</code>, any
+ * name in the {@code X509CRL} must match at least one of the specified
+ * distinguished names. If the value returned is {@code null}, any
* issuer distinguished name will do.
* <p>
- * If the value returned is not <code>null</code>, it is a
- * <code>Collection</code> of names. Each name is a <code>String</code>
+ * If the value returned is not {@code null}, it is a
+ * {@code Collection} of names. Each name is a {@code String}
* or a byte array representing a distinguished name (in RFC 2253 or
* ASN.1 DER encoded form, respectively). Note that the
- * <code>Collection</code> returned may contain duplicate names.
+ * {@code Collection} returned may contain duplicate names.
* <p>
* If a name is specified as a byte array, it should contain a single DER
* encoded distinguished name, as defined in X.501. The ASN.1 notation for
* this structure is given in the documentation for
* {@link #setIssuerNames setIssuerNames(Collection names)}.
* <p>
- * Note that a deep copy is performed on the <code>Collection</code> to
+ * Note that a deep copy is performed on the {@code Collection} to
* protect against subsequent modifications.
*
- * @return a <code>Collection</code> of names (or <code>null</code>)
+ * @return a {@code Collection} of names (or {@code null})
* @see #setIssuerNames
*/
public Collection<Object> getIssuerNames() {
@@ -503,23 +503,23 @@
}
/**
- * Returns the minCRLNumber criterion. The <code>X509CRL</code> must have a
+ * Returns the minCRLNumber criterion. The {@code X509CRL} must have a
* CRL number extension whose value is greater than or equal to the
- * specified value. If <code>null</code>, no minCRLNumber check will be done.
+ * specified value. If {@code null}, no minCRLNumber check will be done.
*
- * @return the minimum CRL number accepted (or <code>null</code>)
+ * @return the minimum CRL number accepted (or {@code null})
*/
public BigInteger getMinCRL() {
return minCRL;
}
/**
- * Returns the maxCRLNumber criterion. The <code>X509CRL</code> must have a
+ * Returns the maxCRLNumber criterion. The {@code X509CRL} must have a
* CRL number extension whose value is less than or equal to the
- * specified value. If <code>null</code>, no maxCRLNumber check will be
+ * specified value. If {@code null}, no maxCRLNumber check will be
* done.
*
- * @return the maximum CRL number accepted (or <code>null</code>)
+ * @return the maximum CRL number accepted (or {@code null})
*/
public BigInteger getMaxCRL() {
return maxCRL;
@@ -528,15 +528,15 @@
/**
* Returns the dateAndTime criterion. The specified date must be
* equal to or later than the value of the thisUpdate component
- * of the <code>X509CRL</code> and earlier than the value of the
+ * of the {@code X509CRL} and earlier than the value of the
* nextUpdate component. There is no match if the
- * <code>X509CRL</code> does not contain a nextUpdate component.
- * If <code>null</code>, no dateAndTime check will be done.
+ * {@code X509CRL} does not contain a nextUpdate component.
+ * If {@code null}, no dateAndTime check will be done.
* <p>
- * Note that the <code>Date</code> returned is cloned to protect against
+ * Note that the {@code Date} returned is cloned to protect against
* subsequent modifications.
*
- * @return the <code>Date</code> to match against (or <code>null</code>)
+ * @return the {@code Date} to match against (or {@code null})
* @see #setDateAndTime
*/
public Date getDateAndTime() {
@@ -547,12 +547,12 @@
/**
* Returns the certificate being checked. This is not a criterion. Rather,
- * it is optional information that may help a <code>CertStore</code>
+ * it is optional information that may help a {@code CertStore}
* find CRLs that would be relevant when checking revocation for the
- * specified certificate. If the value returned is <code>null</code>, then
+ * specified certificate. If the value returned is {@code null}, then
* no such optional information is provided.
*
- * @return the certificate being checked (or <code>null</code>)
+ * @return the certificate being checked (or {@code null})
* @see #setCertificateChecking
*/
public X509Certificate getCertificateChecking() {
@@ -560,10 +560,10 @@
}
/**
- * Returns a printable representation of the <code>X509CRLSelector</code>.
+ * Returns a printable representation of the {@code X509CRLSelector}.
*
- * @return a <code>String</code> describing the contents of the
- * <code>X509CRLSelector</code>.
+ * @return a {@code String} describing the contents of the
+ * {@code X509CRLSelector}.
*/
public String toString() {
StringBuffer sb = new StringBuffer();
@@ -587,11 +587,11 @@
}
/**
- * Decides whether a <code>CRL</code> should be selected.
+ * Decides whether a {@code CRL} should be selected.
*
- * @param crl the <code>CRL</code> to be checked
- * @return <code>true</code> if the <code>CRL</code> should be selected,
- * <code>false</code> otherwise
+ * @param crl the {@code CRL} to be checked
+ * @return {@code true} if the {@code CRL} should be selected,
+ * {@code false} otherwise
*/
public boolean match(CRL crl) {
if (!(crl instanceof X509CRL)) {
@@ -632,7 +632,7 @@
byte[] encoded = in.getOctetString();
CRLNumberExtension crlNumExt =
new CRLNumberExtension(Boolean.FALSE, encoded);
- crlNum = (BigInteger)crlNumExt.get(CRLNumberExtension.NUMBER);
+ crlNum = crlNumExt.get(CRLNumberExtension.NUMBER);
} catch (IOException ex) {
if (debug != null) {
debug.println("X509CRLSelector.match: exception in "
@@ -679,10 +679,14 @@
nowPlusSkew = new Date(dateAndTime.getTime() + skew);
nowMinusSkew = new Date(dateAndTime.getTime() - skew);
}
+
+ // Check that the test date is within the validity interval:
+ // [ thisUpdate - MAX_CLOCK_SKEW,
+ // nextUpdate + MAX_CLOCK_SKEW ]
if (nowMinusSkew.after(nextUpdate)
|| nowPlusSkew.before(crlThisUpdate)) {
if (debug != null) {
- debug.println("X509CRLSelector.match: update out of range");
+ debug.println("X509CRLSelector.match: update out-of-range");
}
return false;
}
@@ -708,7 +712,7 @@
return copy;
} catch (CloneNotSupportedException e) {
/* Cannot happen */
- throw new InternalError(e.toString());
+ throw new InternalError(e.toString(), e);
}
}
}
diff --git a/ojluni/src/main/java/java/security/cert/X509CertSelector.java b/ojluni/src/main/java/java/security/cert/X509CertSelector.java
index 9900080..d4952da 100644
--- a/ojluni/src/main/java/java/security/cert/X509CertSelector.java
+++ b/ojluni/src/main/java/java/security/cert/X509CertSelector.java
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2014 The Android Open Source Project
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -40,27 +40,27 @@
import sun.security.x509.*;
/**
- * A <code>CertSelector</code> that selects <code>X509Certificates</code> that
+ * A {@code CertSelector} that selects {@code X509Certificates} that
* match all specified criteria. This class is particularly useful when
- * selecting certificates from a <code>CertStore</code> to build a
+ * selecting certificates from a {@code CertStore} to build a
* PKIX-compliant certification path.
* <p>
- * When first constructed, an <code>X509CertSelector</code> has no criteria
- * enabled and each of the <code>get</code> methods return a default value
- * (<code>null</code>, or <code>-1</code> for the {@link #getBasicConstraints
+ * When first constructed, an {@code X509CertSelector} has no criteria
+ * enabled and each of the {@code get} methods return a default value
+ * ({@code null}, or {@code -1} for the {@link #getBasicConstraints
* getBasicConstraints} method). Therefore, the {@link #match match}
- * method would return <code>true</code> for any <code>X509Certificate</code>.
+ * method would return {@code true} for any {@code X509Certificate}.
* Typically, several criteria are enabled (by calling
* {@link #setIssuer setIssuer} or
* {@link #setKeyUsage setKeyUsage}, for instance) and then the
- * <code>X509CertSelector</code> is passed to
+ * {@code X509CertSelector} is passed to
* {@link CertStore#getCertificates CertStore.getCertificates} or some similar
* method.
* <p>
* Several criteria can be enabled (by calling {@link #setIssuer setIssuer}
* and {@link #setSerialNumber setSerialNumber},
- * for example) such that the <code>match</code> method
- * usually uniquely matches a single <code>X509Certificate</code>. We say
+ * for example) such that the {@code match} method
+ * usually uniquely matches a single {@code X509Certificate}. We say
* usually, since it is possible for two issuing CAs to have the same
* distinguished name and each issue a certificate with the same serial
* number. Other unique combinations include the issuer, subject,
@@ -150,8 +150,8 @@
static final int NAME_OID = 8;
/**
- * Creates an <code>X509CertSelector</code>. Initially, no criteria are set
- * so any <code>X509Certificate</code> will match.
+ * Creates an {@code X509CertSelector}. Initially, no criteria are set
+ * so any {@code X509Certificate} will match.
*/
public X509CertSelector() {
// empty
@@ -159,17 +159,17 @@
/**
* Sets the certificateEquals criterion. The specified
- * <code>X509Certificate</code> must be equal to the
- * <code>X509Certificate</code> passed to the <code>match</code> method.
- * If <code>null</code>, then this check is not applied.
+ * {@code X509Certificate} must be equal to the
+ * {@code X509Certificate} passed to the {@code match} method.
+ * If {@code null}, then this check is not applied.
*
* <p>This method is particularly useful when it is necessary to
* match a single certificate. Although other criteria can be specified
* in conjunction with the certificateEquals criterion, it is usually not
* practical or necessary.
*
- * @param cert the <code>X509Certificate</code> to match (or
- * <code>null</code>)
+ * @param cert the {@code X509Certificate} to match (or
+ * {@code null})
* @see #getCertificate
*/
public void setCertificate(X509Certificate cert) {
@@ -179,11 +179,11 @@
/**
* Sets the serialNumber criterion. The specified serial number
* must match the certificate serial number in the
- * <code>X509Certificate</code>. If <code>null</code>, any certificate
+ * {@code X509Certificate}. If {@code null}, any certificate
* serial number will do.
*
* @param serial the certificate serial number to match
- * (or <code>null</code>)
+ * (or {@code null})
* @see #getSerialNumber
*/
public void setSerialNumber(BigInteger serial) {
@@ -193,11 +193,11 @@
/**
* Sets the issuer criterion. The specified distinguished name
* must match the issuer distinguished name in the
- * <code>X509Certificate</code>. If <code>null</code>, any issuer
+ * {@code X509Certificate}. If {@code null}, any issuer
* distinguished name will do.
*
* @param issuer a distinguished name as X500Principal
- * (or <code>null</code>)
+ * (or {@code null})
* @since 1.5
*/
public void setIssuer(X500Principal issuer) {
@@ -214,14 +214,14 @@
* <p>
* Sets the issuer criterion. The specified distinguished name
* must match the issuer distinguished name in the
- * <code>X509Certificate</code>. If <code>null</code>, any issuer
+ * {@code X509Certificate}. If {@code null}, any issuer
* distinguished name will do.
* <p>
- * If <code>issuerDN</code> is not <code>null</code>, it should contain a
+ * If {@code issuerDN} is not {@code null}, it should contain a
* distinguished name, in RFC 2253 format.
*
* @param issuerDN a distinguished name in RFC 2253 format
- * (or <code>null</code>)
+ * (or {@code null})
* @throws IOException if a parsing error occurs (incorrect form for DN)
*/
public void setIssuer(String issuerDN) throws IOException {
@@ -235,14 +235,14 @@
/**
* Sets the issuer criterion. The specified distinguished name
* must match the issuer distinguished name in the
- * <code>X509Certificate</code>. If <code>null</code> is specified,
+ * {@code X509Certificate}. If {@code null} is specified,
* the issuer criterion is disabled and any issuer distinguished name will
* do.
* <p>
- * If <code>issuerDN</code> is not <code>null</code>, it should contain a
+ * If {@code issuerDN} is not {@code null}, it should contain a
* single DER encoded distinguished name, as defined in X.501. The ASN.1
* notation for this structure is as follows.
- * <pre><code>
+ * <pre>{@code
* Name ::= CHOICE {
* RDNSequence }
*
@@ -265,31 +265,31 @@
* universalString UniversalString (SIZE (1..MAX)),
* utf8String UTF8String (SIZE (1.. MAX)),
* bmpString BMPString (SIZE (1..MAX)) }
- * </code></pre>
+ * }</pre>
* <p>
* Note that the byte array specified here is cloned to protect against
* subsequent modifications.
*
* @param issuerDN a byte array containing the distinguished name
- * in ASN.1 DER encoded form (or <code>null</code>)
+ * in ASN.1 DER encoded form (or {@code null})
* @throws IOException if an encoding error occurs (incorrect form for DN)
*/
public void setIssuer(byte[] issuerDN) throws IOException {
try {
issuer = (issuerDN == null ? null : new X500Principal(issuerDN));
} catch (IllegalArgumentException e) {
- throw (IOException)new IOException("Invalid name").initCause(e);
+ throw new IOException("Invalid name", e);
}
}
/**
* Sets the subject criterion. The specified distinguished name
* must match the subject distinguished name in the
- * <code>X509Certificate</code>. If <code>null</code>, any subject
+ * {@code X509Certificate}. If {@code null}, any subject
* distinguished name will do.
*
* @param subject a distinguished name as X500Principal
- * (or <code>null</code>)
+ * (or {@code null})
* @since 1.5
*/
public void setSubject(X500Principal subject) {
@@ -305,14 +305,14 @@
* <p>
* Sets the subject criterion. The specified distinguished name
* must match the subject distinguished name in the
- * <code>X509Certificate</code>. If <code>null</code>, any subject
+ * {@code X509Certificate}. If {@code null}, any subject
* distinguished name will do.
* <p>
- * If <code>subjectDN</code> is not <code>null</code>, it should contain a
+ * If {@code subjectDN} is not {@code null}, it should contain a
* distinguished name, in RFC 2253 format.
*
* @param subjectDN a distinguished name in RFC 2253 format
- * (or <code>null</code>)
+ * (or {@code null})
* @throws IOException if a parsing error occurs (incorrect form for DN)
*/
public void setSubject(String subjectDN) throws IOException {
@@ -326,56 +326,56 @@
/**
* Sets the subject criterion. The specified distinguished name
* must match the subject distinguished name in the
- * <code>X509Certificate</code>. If <code>null</code>, any subject
+ * {@code X509Certificate}. If {@code null}, any subject
* distinguished name will do.
* <p>
- * If <code>subjectDN</code> is not <code>null</code>, it should contain a
+ * If {@code subjectDN} is not {@code null}, it should contain a
* single DER encoded distinguished name, as defined in X.501. For the ASN.1
* notation for this structure, see
* {@link #setIssuer(byte [] issuerDN) setIssuer(byte [] issuerDN)}.
*
* @param subjectDN a byte array containing the distinguished name in
- * ASN.1 DER format (or <code>null</code>)
+ * ASN.1 DER format (or {@code null})
* @throws IOException if an encoding error occurs (incorrect form for DN)
*/
public void setSubject(byte[] subjectDN) throws IOException {
try {
subject = (subjectDN == null ? null : new X500Principal(subjectDN));
} catch (IllegalArgumentException e) {
- throw (IOException)new IOException("Invalid name").initCause(e);
+ throw new IOException("Invalid name", e);
}
}
/**
* Sets the subjectKeyIdentifier criterion. The
- * <code>X509Certificate</code> must contain a SubjectKeyIdentifier
+ * {@code X509Certificate} must contain a SubjectKeyIdentifier
* extension for which the contents of the extension
* matches the specified criterion value.
- * If the criterion value is <code>null</code>, no
+ * If the criterion value is {@code null}, no
* subjectKeyIdentifier check will be done.
* <p>
- * If <code>subjectKeyID</code> is not <code>null</code>, it
+ * If {@code subjectKeyID} is not {@code null}, it
* should contain a single DER encoded value corresponding to the contents
* of the extension value (not including the object identifier,
* criticality setting, and encapsulating OCTET STRING)
* for a SubjectKeyIdentifier extension.
* The ASN.1 notation for this structure follows.
- * <p>
- * <pre><code>
+ *
+ * <pre>{@code
* SubjectKeyIdentifier ::= KeyIdentifier
*
* KeyIdentifier ::= OCTET STRING
- * </code></pre>
+ * }</pre>
* <p>
* Since the format of subject key identifiers is not mandated by
* any standard, subject key identifiers are not parsed by the
- * <code>X509CertSelector</code>. Instead, the values are compared using
+ * {@code X509CertSelector}. Instead, the values are compared using
* a byte-by-byte comparison.
* <p>
* Note that the byte array supplied here is cloned to protect against
* subsequent modifications.
*
- * @param subjectKeyID the subject key identifier (or <code>null</code>)
+ * @param subjectKeyID the subject key identifier (or {@code null})
* @see #getSubjectKeyIdentifier
*/
public void setSubjectKeyIdentifier(byte[] subjectKeyID) {
@@ -388,46 +388,46 @@
/**
* Sets the authorityKeyIdentifier criterion. The
- * <code>X509Certificate</code> must contain an
+ * {@code X509Certificate} must contain an
* AuthorityKeyIdentifier extension for which the contents of the
* extension value matches the specified criterion value.
- * If the criterion value is <code>null</code>, no
+ * If the criterion value is {@code null}, no
* authorityKeyIdentifier check will be done.
* <p>
- * If <code>authorityKeyID</code> is not <code>null</code>, it
+ * If {@code authorityKeyID} is not {@code null}, it
* should contain a single DER encoded value corresponding to the contents
* of the extension value (not including the object identifier,
* criticality setting, and encapsulating OCTET STRING)
* for an AuthorityKeyIdentifier extension.
* The ASN.1 notation for this structure follows.
- * <p>
- * <pre><code>
+ *
+ * <pre>{@code
* AuthorityKeyIdentifier ::= SEQUENCE {
* keyIdentifier [0] KeyIdentifier OPTIONAL,
* authorityCertIssuer [1] GeneralNames OPTIONAL,
* authorityCertSerialNumber [2] CertificateSerialNumber OPTIONAL }
*
* KeyIdentifier ::= OCTET STRING
- * </code></pre>
+ * }</pre>
* <p>
* Authority key identifiers are not parsed by the
- * <code>X509CertSelector</code>. Instead, the values are
+ * {@code X509CertSelector}. Instead, the values are
* compared using a byte-by-byte comparison.
* <p>
- * When the <code>keyIdentifier</code> field of
- * <code>AuthorityKeyIdentifier</code> is populated, the value is
- * usually taken from the <code>SubjectKeyIdentifier</code> extension
+ * When the {@code keyIdentifier} field of
+ * {@code AuthorityKeyIdentifier} is populated, the value is
+ * usually taken from the {@code SubjectKeyIdentifier} extension
* in the issuer's certificate. Note, however, that the result of
- * <code>X509Certificate.getExtensionValue(<SubjectKeyIdentifier Object
- * Identifier>)</code> on the issuer's certificate may NOT be used
- * directly as the input to <code>setAuthorityKeyIdentifier</code>.
+ * {@code X509Certificate.getExtensionValue(<SubjectKeyIdentifier Object
+ * Identifier>)} on the issuer's certificate may NOT be used
+ * directly as the input to {@code setAuthorityKeyIdentifier}.
* This is because the SubjectKeyIdentifier contains
* only a KeyIdentifier OCTET STRING, and not a SEQUENCE of
* KeyIdentifier, GeneralNames, and CertificateSerialNumber.
* In order to use the extension value of the issuer certificate's
- * <code>SubjectKeyIdentifier</code>
+ * {@code SubjectKeyIdentifier}
* extension, it will be necessary to extract the value of the embedded
- * <code>KeyIdentifier</code> OCTET STRING, then DER encode this OCTET
+ * {@code KeyIdentifier} OCTET STRING, then DER encode this OCTET
* STRING inside a SEQUENCE.
* For more details on SubjectKeyIdentifier, see
* {@link #setSubjectKeyIdentifier(byte[] subjectKeyID)}.
@@ -436,7 +436,7 @@
* subsequent modifications.
*
* @param authorityKeyID the authority key identifier
- * (or <code>null</code>)
+ * (or {@code null})
* @see #getAuthorityKeyIdentifier
*/
public void setAuthorityKeyIdentifier(byte[] authorityKeyID) {
@@ -450,13 +450,13 @@
/**
* Sets the certificateValid criterion. The specified date must fall
* within the certificate validity period for the
- * <code>X509Certificate</code>. If <code>null</code>, no certificateValid
+ * {@code X509Certificate}. If {@code null}, no certificateValid
* check will be done.
* <p>
- * Note that the <code>Date</code> supplied here is cloned to protect
+ * Note that the {@code Date} supplied here is cloned to protect
* against subsequent modifications.
*
- * @param certValid the <code>Date</code> to check (or <code>null</code>)
+ * @param certValid the {@code Date} to check (or {@code null})
* @see #getCertificateValid
*/
public void setCertificateValid(Date certValid) {
@@ -470,14 +470,14 @@
/**
* Sets the privateKeyValid criterion. The specified date must fall
* within the private key validity period for the
- * <code>X509Certificate</code>. If <code>null</code>, no privateKeyValid
+ * {@code X509Certificate}. If {@code null}, no privateKeyValid
* check will be done.
* <p>
- * Note that the <code>Date</code> supplied here is cloned to protect
+ * Note that the {@code Date} supplied here is cloned to protect
* against subsequent modifications.
*
- * @param privateKeyValid the <code>Date</code> to check (or
- * <code>null</code>)
+ * @param privateKeyValid the {@code Date} to check (or
+ * {@code null})
* @see #getPrivateKeyValid
*/
public void setPrivateKeyValid(Date privateKeyValid) {
@@ -490,12 +490,12 @@
/**
* Sets the subjectPublicKeyAlgID criterion. The
- * <code>X509Certificate</code> must contain a subject public key
- * with the specified algorithm. If <code>null</code>, no
+ * {@code X509Certificate} must contain a subject public key
+ * with the specified algorithm. If {@code null}, no
* subjectPublicKeyAlgID check will be done.
*
* @param oid The object identifier (OID) of the algorithm to check
- * for (or <code>null</code>). An OID is represented by a
+ * for (or {@code null}). An OID is represented by a
* set of nonnegative integers separated by periods.
* @throws IOException if the OID is invalid, such as
* the first component being not 0, 1 or 2 or the second component
@@ -513,10 +513,10 @@
/**
* Sets the subjectPublicKey criterion. The
- * <code>X509Certificate</code> must contain the specified subject public
- * key. If <code>null</code>, no subjectPublicKey check will be done.
+ * {@code X509Certificate} must contain the specified subject public
+ * key. If {@code null}, no subjectPublicKey check will be done.
*
- * @param key the subject public key to check for (or <code>null</code>)
+ * @param key the subject public key to check for (or {@code null})
* @see #getSubjectPublicKey
*/
public void setSubjectPublicKey(PublicKey key) {
@@ -530,17 +530,17 @@
}
/**
- * Sets the subjectPublicKey criterion. The <code>X509Certificate</code>
- * must contain the specified subject public key. If <code>null</code>,
+ * Sets the subjectPublicKey criterion. The {@code X509Certificate}
+ * must contain the specified subject public key. If {@code null},
* no subjectPublicKey check will be done.
* <p>
* Because this method allows the public key to be specified as a byte
* array, it may be used for unknown key types.
* <p>
- * If <code>key</code> is not <code>null</code>, it should contain a
+ * If {@code key} is not {@code null}, it should contain a
* single DER encoded SubjectPublicKeyInfo structure, as defined in X.509.
* The ASN.1 notation for this structure is as follows.
- * <pre><code>
+ * <pre>{@code
* SubjectPublicKeyInfo ::= SEQUENCE {
* algorithm AlgorithmIdentifier,
* subjectPublicKey BIT STRING }
@@ -551,13 +551,13 @@
* -- contains a value of the type
* -- registered for use with the
* -- algorithm object identifier value
- * </code></pre>
+ * }</pre>
* <p>
* Note that the byte array supplied here is cloned to protect against
* subsequent modifications.
*
* @param key a byte array containing the subject public key in ASN.1 DER
- * form (or <code>null</code>)
+ * form (or {@code null})
* @throws IOException if an encoding error occurs (incorrect form for
* subject public key)
* @see #getSubjectPublicKey
@@ -573,9 +573,9 @@
}
/**
- * Sets the keyUsage criterion. The <code>X509Certificate</code>
- * must allow the specified keyUsage values. If <code>null</code>, no
- * keyUsage check will be done. Note that an <code>X509Certificate</code>
+ * Sets the keyUsage criterion. The {@code X509Certificate}
+ * must allow the specified keyUsage values. If {@code null}, no
+ * keyUsage check will be done. Note that an {@code X509Certificate}
* that has no keyUsage extension implicitly allows all keyUsage values.
* <p>
* Note that the boolean array supplied here is cloned to protect against
@@ -584,7 +584,7 @@
* @param keyUsage a boolean array in the same format as the boolean
* array returned by
* {@link X509Certificate#getKeyUsage() X509Certificate.getKeyUsage()}.
- * Or <code>null</code>.
+ * Or {@code null}.
* @see #getKeyUsage
*/
public void setKeyUsage(boolean[] keyUsage) {
@@ -596,18 +596,18 @@
}
/**
- * Sets the extendedKeyUsage criterion. The <code>X509Certificate</code>
+ * Sets the extendedKeyUsage criterion. The {@code X509Certificate}
* must allow the specified key purposes in its extended key usage
- * extension. If <code>keyPurposeSet</code> is empty or <code>null</code>,
+ * extension. If {@code keyPurposeSet} is empty or {@code null},
* no extendedKeyUsage check will be done. Note that an
- * <code>X509Certificate</code> that has no extendedKeyUsage extension
+ * {@code X509Certificate} that has no extendedKeyUsage extension
* implicitly allows all key purposes.
* <p>
- * Note that the <code>Set</code> is cloned to protect against
+ * Note that the {@code Set} is cloned to protect against
* subsequent modifications.
*
- * @param keyPurposeSet a <code>Set</code> of key purpose OIDs in string
- * format (or <code>null</code>). Each OID is represented by a set of
+ * @param keyPurposeSet a {@code Set} of key purpose OIDs in string
+ * format (or {@code null}). Each OID is represented by a set of
* nonnegative integers separated by periods.
* @throws IOException if the OID is invalid, such as
* the first component being not 0, 1 or 2 or the second component
@@ -633,15 +633,15 @@
* specified in the {@link #setSubjectAlternativeNames
* setSubjectAlternativeNames} or {@link #addSubjectAlternativeName
* addSubjectAlternativeName} methods. If enabled,
- * the <code>X509Certificate</code> must contain all of the
+ * the {@code X509Certificate} must contain all of the
* specified subject alternative names. If disabled, the
- * <code>X509Certificate</code> must contain at least one of the
+ * {@code X509Certificate} must contain at least one of the
* specified subject alternative names.
*
- * <p>The matchAllNames flag is <code>true</code> by default.
+ * <p>The matchAllNames flag is {@code true} by default.
*
- * @param matchAllNames if <code>true</code>, the flag is enabled;
- * if <code>false</code>, the flag is disabled.
+ * @param matchAllNames if {@code true}, the flag is enabled;
+ * if {@code false}, the flag is disabled.
* @see #getMatchAllSubjectAltNames
*/
public void setMatchAllSubjectAltNames(boolean matchAllNames) {
@@ -650,7 +650,7 @@
/**
* Sets the subjectAlternativeNames criterion. The
- * <code>X509Certificate</code> must contain all or at least one of the
+ * {@code X509Certificate} must contain all or at least one of the
* specified subjectAlternativeNames, depending on the value of
* the matchAllNames flag (see {@link #setMatchAllSubjectAltNames
* setMatchAllSubjectAltNames}).
@@ -660,19 +660,19 @@
* subjectAlternativeNames criterion. The specified value replaces
* the previous value for the subjectAlternativeNames criterion.
* <p>
- * The <code>names</code> parameter (if not <code>null</code>) is a
- * <code>Collection</code> with one
+ * The {@code names} parameter (if not {@code null}) is a
+ * {@code Collection} with one
* entry for each name to be included in the subject alternative name
- * criterion. Each entry is a <code>List</code> whose first entry is an
- * <code>Integer</code> (the name type, 0-8) and whose second
- * entry is a <code>String</code> or a byte array (the name, in
+ * criterion. Each entry is a {@code List} whose first entry is an
+ * {@code Integer} (the name type, 0-8) and whose second
+ * entry is a {@code String} or a byte array (the name, in
* string or ASN.1 DER encoded form, respectively).
- * There can be multiple names of the same type. If <code>null</code>
+ * There can be multiple names of the same type. If {@code null}
* is supplied as the value for this argument, no
* subjectAlternativeNames check will be performed.
* <p>
- * Each subject alternative name in the <code>Collection</code>
- * may be specified either as a <code>String</code> or as an ASN.1 encoded
+ * Each subject alternative name in the {@code Collection}
+ * may be specified either as a {@code String} or as an ASN.1 encoded
* byte array. For more details about the formats used, see
* {@link #addSubjectAlternativeName(int type, String name)
* addSubjectAlternativeName(int type, String name)} and
@@ -683,15 +683,15 @@
* array form instead of the String form. See the note in
* {@link #addSubjectAlternativeName(int, String)} for more information.
* <p>
- * Note that the <code>names</code> parameter can contain duplicate
+ * Note that the {@code names} parameter can contain duplicate
* names (same name and name type), but they may be removed from the
- * <code>Collection</code> of names returned by the
+ * {@code Collection} of names returned by the
* {@link #getSubjectAlternativeNames getSubjectAlternativeNames} method.
* <p>
- * Note that a deep copy is performed on the <code>Collection</code> to
+ * Note that a deep copy is performed on the {@code Collection} to
* protect against subsequent modifications.
*
- * @param names a <code>Collection</code> of names (or <code>null</code>)
+ * @param names a {@code Collection} of names (or {@code null})
* @throws IOException if a parsing error occurs
* @see #getSubjectAlternativeNames
*/
@@ -715,7 +715,7 @@
/**
* Adds a name to the subjectAlternativeNames criterion. The
- * <code>X509Certificate</code> must contain all or at least one
+ * {@code X509Certificate} must contain all or at least one
* of the specified subjectAlternativeNames, depending on the value of
* the matchAllNames flag (see {@link #setMatchAllSubjectAltNames
* setMatchAllSubjectAltNames}).
@@ -748,7 +748,7 @@
*
* @param type the name type (0-8, as specified in
* RFC 3280, section 4.2.1.7)
- * @param name the name in string form (not <code>null</code>)
+ * @param name the name in string form (not {@code null})
* @throws IOException if a parsing error occurs
*/
public void addSubjectAlternativeName(int type, String name)
@@ -758,7 +758,7 @@
/**
* Adds a name to the subjectAlternativeNames criterion. The
- * <code>X509Certificate</code> must contain all or at least one
+ * {@code X509Certificate} must contain all or at least one
* of the specified subjectAlternativeNames, depending on the value of
* the matchAllNames flag (see {@link #setMatchAllSubjectAltNames
* setMatchAllSubjectAltNames}).
@@ -775,7 +775,7 @@
* the encoded value of the name, and should not include the tag associated
* with the name in the GeneralName structure. The ASN.1 definition of this
* structure appears below.
- * <pre><code>
+ * <pre>{@code
* GeneralName ::= CHOICE {
* otherName [0] OtherName,
* rfc822Name [1] IA5String,
@@ -786,7 +786,7 @@
* uniformResourceIdentifier [6] IA5String,
* iPAddress [7] OCTET STRING,
* registeredID [8] OBJECT IDENTIFIER}
- * </code></pre>
+ * }</pre>
* <p>
* Note that the byte array supplied here is cloned to protect against
* subsequent modifications.
@@ -803,7 +803,7 @@
/**
* A private method that adds a name (String or byte array) to the
- * subjectAlternativeNames criterion. The <code>X509Certificate</code>
+ * subjectAlternativeNames criterion. The {@code X509Certificate}
* must contain the specified subjectAlternativeName.
*
* @param type the name type (0-8, as specified in
@@ -830,19 +830,19 @@
/**
* Parse an argument of the form passed to setSubjectAlternativeNames,
- * returning a <code>Collection</code> of
- * <code>GeneralNameInterface</code>s.
+ * returning a {@code Collection} of
+ * {@code GeneralNameInterface}s.
* Throw an IllegalArgumentException or a ClassCastException
* if the argument is malformed.
*
* @param names a Collection with one entry per name.
- * Each entry is a <code>List</code> whose first entry
+ * Each entry is a {@code List} whose first entry
* is an Integer (the name type, 0-8) and whose second
* entry is a String or a byte array (the name, in
* string or ASN.1 DER encoded form, respectively).
* There can be multiple names of the same type. Null is
* not an acceptable value.
- * @return a Set of <code>GeneralNameInterface</code>s
+ * @return a Set of {@code GeneralNameInterface}s
* @throws IOException if a parsing error occurs
*/
private static Set<GeneralNameInterface> parseNames(Collection<List<?>> names) throws IOException {
@@ -866,14 +866,14 @@
/**
* Compare for equality two objects of the form passed to
* setSubjectAlternativeNames (or X509CRLSelector.setIssuerNames).
- * Throw an <code>IllegalArgumentException</code> or a
- * <code>ClassCastException</code> if one of the objects is malformed.
+ * Throw an {@code IllegalArgumentException} or a
+ * {@code ClassCastException} if one of the objects is malformed.
*
* @param object1 a Collection containing the first object to compare
* @param object2 a Collection containing the second object to compare
* @return true if the objects are equal, false otherwise
*/
- static boolean equalNames(Collection object1, Collection object2) {
+ static boolean equalNames(Collection<?> object1, Collection<?> object2) {
if ((object1 == null) || (object2 == null)) {
return object1 == object2;
}
@@ -881,7 +881,7 @@
}
/**
- * Make a <code>GeneralNameInterface</code> out of a name type (0-8) and an
+ * Make a {@code GeneralNameInterface} out of a name type (0-8) and an
* Object that may be a byte array holding the ASN.1 DER encoded
* name or a String form of the name. Except for X.509
* Distinguished Names, the String form of the name must not be the
@@ -990,7 +990,7 @@
/**
- * Sets the name constraints criterion. The <code>X509Certificate</code>
+ * Sets the name constraints criterion. The {@code X509Certificate}
* must have subject and subject alternative names that
* meet the specified name constraints.
* <p>
@@ -999,7 +999,7 @@
* would appear in the NameConstraints structure defined in RFC 3280
* and X.509. The ASN.1 definition of this structure appears below.
*
- * <pre><code>
+ * <pre>{@code
* NameConstraints ::= SEQUENCE {
* permittedSubtrees [0] GeneralSubtrees OPTIONAL,
* excludedSubtrees [1] GeneralSubtrees OPTIONAL }
@@ -1023,7 +1023,7 @@
* uniformResourceIdentifier [6] IA5String,
* iPAddress [7] OCTET STRING,
* registeredID [8] OBJECT IDENTIFIER}
- * </code></pre>
+ * }</pre>
* <p>
* Note that the byte array supplied here is cloned to protect against
* subsequent modifications.
@@ -1032,7 +1032,7 @@
* a NameConstraints extension to be used for checking
* name constraints. Only the value of the extension is
* included, not the OID or criticality flag. Can be
- * <code>null</code>,
+ * {@code null},
* in which case no name constraints check will be performed.
* @throws IOException if a parsing error occurs
* @see #getNameConstraints
@@ -1049,7 +1049,7 @@
/**
* Sets the basic constraints constraint. If the value is greater than or
- * equal to zero, <code>X509Certificates</code> must include a
+ * equal to zero, {@code X509Certificates} must include a
* basicConstraints extension with
* a pathLen of at least this value. If the value is -2, only end-entity
* certificates are accepted. If the value is -1, no check is done.
@@ -1071,18 +1071,18 @@
}
/**
- * Sets the policy constraint. The <code>X509Certificate</code> must
+ * Sets the policy constraint. The {@code X509Certificate} must
* include at least one of the specified policies in its certificate
- * policies extension. If <code>certPolicySet</code> is empty, then the
- * <code>X509Certificate</code> must include at least some specified policy
- * in its certificate policies extension. If <code>certPolicySet</code> is
- * <code>null</code>, no policy check will be performed.
+ * policies extension. If {@code certPolicySet} is empty, then the
+ * {@code X509Certificate} must include at least some specified policy
+ * in its certificate policies extension. If {@code certPolicySet} is
+ * {@code null}, no policy check will be performed.
* <p>
- * Note that the <code>Set</code> is cloned to protect against
+ * Note that the {@code Set} is cloned to protect against
* subsequent modifications.
*
- * @param certPolicySet a <code>Set</code> of certificate policy OIDs in
- * string format (or <code>null</code>). Each OID is
+ * @param certPolicySet a {@code Set} of certificate policy OIDs in
+ * string format (or {@code null}). Each OID is
* represented by a set of nonnegative integers
* separated by periods.
* @throws IOException if a parsing error occurs on the OID such as
@@ -1116,12 +1116,12 @@
}
/**
- * Sets the pathToNames criterion. The <code>X509Certificate</code> must
+ * Sets the pathToNames criterion. The {@code X509Certificate} must
* not include name constraints that would prohibit building a
* path to the specified names.
* <p>
* This method allows the caller to specify, with a single method call,
- * the complete set of names which the <code>X509Certificates</code>'s
+ * the complete set of names which the {@code X509Certificates}'s
* name constraints must permit. The specified value replaces
* the previous value for the pathToNames criterion.
* <p>
@@ -1130,19 +1130,19 @@
* built, any candidate certificate must not include name constraints that
* would prohibit building a path to any of the names in the partial path.
* <p>
- * The <code>names</code> parameter (if not <code>null</code>) is a
- * <code>Collection</code> with one
+ * The {@code names} parameter (if not {@code null}) is a
+ * {@code Collection} with one
* entry for each name to be included in the pathToNames
- * criterion. Each entry is a <code>List</code> whose first entry is an
- * <code>Integer</code> (the name type, 0-8) and whose second
- * entry is a <code>String</code> or a byte array (the name, in
+ * criterion. Each entry is a {@code List} whose first entry is an
+ * {@code Integer} (the name type, 0-8) and whose second
+ * entry is a {@code String} or a byte array (the name, in
* string or ASN.1 DER encoded form, respectively).
- * There can be multiple names of the same type. If <code>null</code>
+ * There can be multiple names of the same type. If {@code null}
* is supplied as the value for this argument, no
* pathToNames check will be performed.
* <p>
- * Each name in the <code>Collection</code>
- * may be specified either as a <code>String</code> or as an ASN.1 encoded
+ * Each name in the {@code Collection}
+ * may be specified either as a {@code String} or as an ASN.1 encoded
* byte array. For more details about the formats used, see
* {@link #addPathToName(int type, String name)
* addPathToName(int type, String name)} and
@@ -1153,16 +1153,16 @@
* array form instead of the String form. See the note in
* {@link #addPathToName(int, String)} for more information.
* <p>
- * Note that the <code>names</code> parameter can contain duplicate
+ * Note that the {@code names} parameter can contain duplicate
* names (same name and name type), but they may be removed from the
- * <code>Collection</code> of names returned by the
+ * {@code Collection} of names returned by the
* {@link #getPathToNames getPathToNames} method.
* <p>
- * Note that a deep copy is performed on the <code>Collection</code> to
+ * Note that a deep copy is performed on the {@code Collection} to
* protect against subsequent modifications.
*
- * @param names a <code>Collection</code> with one entry per name
- * (or <code>null</code>)
+ * @param names a {@code Collection} with one entry per name
+ * (or {@code null})
* @throws IOException if a parsing error occurs
* @see #getPathToNames
*/
@@ -1187,12 +1187,12 @@
}
/**
- * Adds a name to the pathToNames criterion. The <code>X509Certificate</code>
+ * Adds a name to the pathToNames criterion. The {@code X509Certificate}
* must not include name constraints that would prohibit building a
* path to the specified name.
* <p>
* This method allows the caller to add a name to the set of names which
- * the <code>X509Certificates</code>'s name constraints must permit.
+ * the {@code X509Certificates}'s name constraints must permit.
* The specified name is added to any previous value for the
* pathToNames criterion. If the name is a duplicate, it may be ignored.
* <p>
@@ -1224,12 +1224,12 @@
}
/**
- * Adds a name to the pathToNames criterion. The <code>X509Certificate</code>
+ * Adds a name to the pathToNames criterion. The {@code X509Certificate}
* must not include name constraints that would prohibit building a
* path to the specified name.
* <p>
* This method allows the caller to add a name to the set of names which
- * the <code>X509Certificates</code>'s name constraints must permit.
+ * the {@code X509Certificates}'s name constraints must permit.
* The specified name is added to any previous value for the
* pathToNames criterion. If the name is a duplicate, it may be ignored.
* <p>
@@ -1255,7 +1255,7 @@
/**
* A private method that adds a name (String or byte array) to the
- * pathToNames criterion. The <code>X509Certificate</code> must contain
+ * pathToNames criterion. The {@code X509Certificate} must contain
* the specified pathToName.
*
* @param type the name type (0-8, as specified in
@@ -1280,11 +1280,11 @@
/**
* Returns the certificateEquals criterion. The specified
- * <code>X509Certificate</code> must be equal to the
- * <code>X509Certificate</code> passed to the <code>match</code> method.
- * If <code>null</code>, this check is not applied.
+ * {@code X509Certificate} must be equal to the
+ * {@code X509Certificate} passed to the {@code match} method.
+ * If {@code null}, this check is not applied.
*
- * @return the <code>X509Certificate</code> to match (or <code>null</code>)
+ * @return the {@code X509Certificate} to match (or {@code null})
* @see #setCertificate
*/
public X509Certificate getCertificate() {
@@ -1294,11 +1294,11 @@
/**
* Returns the serialNumber criterion. The specified serial number
* must match the certificate serial number in the
- * <code>X509Certificate</code>. If <code>null</code>, any certificate
+ * {@code X509Certificate}. If {@code null}, any certificate
* serial number will do.
*
* @return the certificate serial number to match
- * (or <code>null</code>)
+ * (or {@code null})
* @see #setSerialNumber
*/
public BigInteger getSerialNumber() {
@@ -1306,13 +1306,13 @@
}
/**
- * Returns the issuer criterion as an <code>X500Principal</code>. This
+ * Returns the issuer criterion as an {@code X500Principal}. This
* distinguished name must match the issuer distinguished name in the
- * <code>X509Certificate</code>. If <code>null</code>, the issuer criterion
+ * {@code X509Certificate}. If {@code null}, the issuer criterion
* is disabled and any issuer distinguished name will do.
*
* @return the required issuer distinguished name as X500Principal
- * (or <code>null</code>)
+ * (or {@code null})
* @since 1.5
*/
public X500Principal getIssuer() {
@@ -1326,16 +1326,16 @@
* encoding information in the RFC 2253 String form of some distinguished
* names.
* <p>
- * Returns the issuer criterion as a <code>String</code>. This
+ * Returns the issuer criterion as a {@code String}. This
* distinguished name must match the issuer distinguished name in the
- * <code>X509Certificate</code>. If <code>null</code>, the issuer criterion
+ * {@code X509Certificate}. If {@code null}, the issuer criterion
* is disabled and any issuer distinguished name will do.
* <p>
- * If the value returned is not <code>null</code>, it is a
+ * If the value returned is not {@code null}, it is a
* distinguished name, in RFC 2253 format.
*
* @return the required issuer distinguished name in RFC 2253 format
- * (or <code>null</code>)
+ * (or {@code null})
*/
public String getIssuerAsString() {
return (issuer == null ? null : issuer.getName());
@@ -1344,10 +1344,10 @@
/**
* Returns the issuer criterion as a byte array. This distinguished name
* must match the issuer distinguished name in the
- * <code>X509Certificate</code>. If <code>null</code>, the issuer criterion
+ * {@code X509Certificate}. If {@code null}, the issuer criterion
* is disabled and any issuer distinguished name will do.
* <p>
- * If the value returned is not <code>null</code>, it is a byte
+ * If the value returned is not {@code null}, it is a byte
* array containing a single DER encoded distinguished name, as defined in
* X.501. The ASN.1 notation for this structure is supplied in the
* documentation for
@@ -1357,7 +1357,7 @@
* subsequent modifications.
*
* @return a byte array containing the required issuer distinguished name
- * in ASN.1 DER format (or <code>null</code>)
+ * in ASN.1 DER format (or {@code null})
* @throws IOException if an encoding error occurs
*/
public byte[] getIssuerAsBytes() throws IOException {
@@ -1365,13 +1365,13 @@
}
/**
- * Returns the subject criterion as an <code>X500Principal</code>. This
+ * Returns the subject criterion as an {@code X500Principal}. This
* distinguished name must match the subject distinguished name in the
- * <code>X509Certificate</code>. If <code>null</code>, the subject criterion
+ * {@code X509Certificate}. If {@code null}, the subject criterion
* is disabled and any subject distinguished name will do.
*
* @return the required subject distinguished name as X500Principal
- * (or <code>null</code>)
+ * (or {@code null})
* @since 1.5
*/
public X500Principal getSubject() {
@@ -1385,16 +1385,16 @@
* encoding information in the RFC 2253 String form of some distinguished
* names.
* <p>
- * Returns the subject criterion as a <code>String</code>. This
+ * Returns the subject criterion as a {@code String}. This
* distinguished name must match the subject distinguished name in the
- * <code>X509Certificate</code>. If <code>null</code>, the subject criterion
+ * {@code X509Certificate}. If {@code null}, the subject criterion
* is disabled and any subject distinguished name will do.
* <p>
- * If the value returned is not <code>null</code>, it is a
+ * If the value returned is not {@code null}, it is a
* distinguished name, in RFC 2253 format.
*
* @return the required subject distinguished name in RFC 2253 format
- * (or <code>null</code>)
+ * (or {@code null})
*/
public String getSubjectAsString() {
return (subject == null ? null : subject.getName());
@@ -1403,10 +1403,10 @@
/**
* Returns the subject criterion as a byte array. This distinguished name
* must match the subject distinguished name in the
- * <code>X509Certificate</code>. If <code>null</code>, the subject criterion
+ * {@code X509Certificate}. If {@code null}, the subject criterion
* is disabled and any subject distinguished name will do.
* <p>
- * If the value returned is not <code>null</code>, it is a byte
+ * If the value returned is not {@code null}, it is a byte
* array containing a single DER encoded distinguished name, as defined in
* X.501. The ASN.1 notation for this structure is supplied in the
* documentation for
@@ -1416,7 +1416,7 @@
* subsequent modifications.
*
* @return a byte array containing the required subject distinguished name
- * in ASN.1 DER format (or <code>null</code>)
+ * in ASN.1 DER format (or {@code null})
* @throws IOException if an encoding error occurs
*/
public byte[] getSubjectAsBytes() throws IOException {
@@ -1425,14 +1425,14 @@
/**
* Returns the subjectKeyIdentifier criterion. The
- * <code>X509Certificate</code> must contain a SubjectKeyIdentifier
- * extension with the specified value. If <code>null</code>, no
+ * {@code X509Certificate} must contain a SubjectKeyIdentifier
+ * extension with the specified value. If {@code null}, no
* subjectKeyIdentifier check will be done.
* <p>
* Note that the byte array returned is cloned to protect against
* subsequent modifications.
*
- * @return the key identifier (or <code>null</code>)
+ * @return the key identifier (or {@code null})
* @see #setSubjectKeyIdentifier
*/
public byte[] getSubjectKeyIdentifier() {
@@ -1444,14 +1444,14 @@
/**
* Returns the authorityKeyIdentifier criterion. The
- * <code>X509Certificate</code> must contain a AuthorityKeyIdentifier
- * extension with the specified value. If <code>null</code>, no
+ * {@code X509Certificate} must contain a AuthorityKeyIdentifier
+ * extension with the specified value. If {@code null}, no
* authorityKeyIdentifier check will be done.
* <p>
* Note that the byte array returned is cloned to protect against
* subsequent modifications.
*
- * @return the key identifier (or <code>null</code>)
+ * @return the key identifier (or {@code null})
* @see #setAuthorityKeyIdentifier
*/
public byte[] getAuthorityKeyIdentifier() {
@@ -1464,13 +1464,13 @@
/**
* Returns the certificateValid criterion. The specified date must fall
* within the certificate validity period for the
- * <code>X509Certificate</code>. If <code>null</code>, no certificateValid
+ * {@code X509Certificate}. If {@code null}, no certificateValid
* check will be done.
* <p>
- * Note that the <code>Date</code> returned is cloned to protect against
+ * Note that the {@code Date} returned is cloned to protect against
* subsequent modifications.
*
- * @return the <code>Date</code> to check (or <code>null</code>)
+ * @return the {@code Date} to check (or {@code null})
* @see #setCertificateValid
*/
public Date getCertificateValid() {
@@ -1483,13 +1483,13 @@
/**
* Returns the privateKeyValid criterion. The specified date must fall
* within the private key validity period for the
- * <code>X509Certificate</code>. If <code>null</code>, no privateKeyValid
+ * {@code X509Certificate}. If {@code null}, no privateKeyValid
* check will be done.
* <p>
- * Note that the <code>Date</code> returned is cloned to protect against
+ * Note that the {@code Date} returned is cloned to protect against
* subsequent modifications.
*
- * @return the <code>Date</code> to check (or <code>null</code>)
+ * @return the {@code Date} to check (or {@code null})
* @see #setPrivateKeyValid
*/
public Date getPrivateKeyValid() {
@@ -1501,12 +1501,12 @@
/**
* Returns the subjectPublicKeyAlgID criterion. The
- * <code>X509Certificate</code> must contain a subject public key
- * with the specified algorithm. If <code>null</code>, no
+ * {@code X509Certificate} must contain a subject public key
+ * with the specified algorithm. If {@code null}, no
* subjectPublicKeyAlgID check will be done.
*
* @return the object identifier (OID) of the signature algorithm to check
- * for (or <code>null</code>). An OID is represented by a set of
+ * for (or {@code null}). An OID is represented by a set of
* nonnegative integers separated by periods.
* @see #setSubjectPublicKeyAlgID
*/
@@ -1519,10 +1519,10 @@
/**
* Returns the subjectPublicKey criterion. The
- * <code>X509Certificate</code> must contain the specified subject
- * public key. If <code>null</code>, no subjectPublicKey check will be done.
+ * {@code X509Certificate} must contain the specified subject
+ * public key. If {@code null}, no subjectPublicKey check will be done.
*
- * @return the subject public key to check for (or <code>null</code>)
+ * @return the subject public key to check for (or {@code null})
* @see #setSubjectPublicKey
*/
public PublicKey getSubjectPublicKey() {
@@ -1530,7 +1530,7 @@
}
/**
- * Returns the keyUsage criterion. The <code>X509Certificate</code>
+ * Returns the keyUsage criterion. The {@code X509Certificate}
* must allow the specified keyUsage values. If null, no keyUsage
* check will be done.
* <p>
@@ -1540,7 +1540,7 @@
* @return a boolean array in the same format as the boolean
* array returned by
* {@link X509Certificate#getKeyUsage() X509Certificate.getKeyUsage()}.
- * Or <code>null</code>.
+ * Or {@code null}.
* @see #setKeyUsage
*/
public boolean[] getKeyUsage() {
@@ -1551,15 +1551,15 @@
}
/**
- * Returns the extendedKeyUsage criterion. The <code>X509Certificate</code>
+ * Returns the extendedKeyUsage criterion. The {@code X509Certificate}
* must allow the specified key purposes in its extended key usage
- * extension. If the <code>keyPurposeSet</code> returned is empty or
- * <code>null</code>, no extendedKeyUsage check will be done. Note that an
- * <code>X509Certificate</code> that has no extendedKeyUsage extension
+ * extension. If the {@code keyPurposeSet} returned is empty or
+ * {@code null}, no extendedKeyUsage check will be done. Note that an
+ * {@code X509Certificate} that has no extendedKeyUsage extension
* implicitly allows all key purposes.
*
- * @return an immutable <code>Set</code> of key purpose OIDs in string
- * format (or <code>null</code>)
+ * @return an immutable {@code Set} of key purpose OIDs in string
+ * format (or {@code null})
* @see #setExtendedKeyUsage
*/
public Set<String> getExtendedKeyUsage() {
@@ -1567,19 +1567,19 @@
}
/**
- * Indicates if the <code>X509Certificate</code> must contain all
+ * Indicates if the {@code X509Certificate} must contain all
* or at least one of the subjectAlternativeNames
* specified in the {@link #setSubjectAlternativeNames
* setSubjectAlternativeNames} or {@link #addSubjectAlternativeName
- * addSubjectAlternativeName} methods. If <code>true</code>,
- * the <code>X509Certificate</code> must contain all of the
- * specified subject alternative names. If <code>false</code>, the
- * <code>X509Certificate</code> must contain at least one of the
+ * addSubjectAlternativeName} methods. If {@code true},
+ * the {@code X509Certificate} must contain all of the
+ * specified subject alternative names. If {@code false}, the
+ * {@code X509Certificate} must contain at least one of the
* specified subject alternative names.
*
- * @return <code>true</code> if the flag is enabled;
- * <code>false</code> if the flag is disabled. The flag is
- * <code>true</code> by default.
+ * @return {@code true} if the flag is enabled;
+ * {@code false} if the flag is disabled. The flag is
+ * {@code true} by default.
* @see #setMatchAllSubjectAltNames
*/
public boolean getMatchAllSubjectAltNames() {
@@ -1588,35 +1588,35 @@
/**
* Returns a copy of the subjectAlternativeNames criterion.
- * The <code>X509Certificate</code> must contain all or at least one
+ * The {@code X509Certificate} must contain all or at least one
* of the specified subjectAlternativeNames, depending on the value
* of the matchAllNames flag (see {@link #getMatchAllSubjectAltNames
* getMatchAllSubjectAltNames}). If the value returned is
- * <code>null</code>, no subjectAlternativeNames check will be performed.
+ * {@code null}, no subjectAlternativeNames check will be performed.
* <p>
- * If the value returned is not <code>null</code>, it is a
- * <code>Collection</code> with
+ * If the value returned is not {@code null}, it is a
+ * {@code Collection} with
* one entry for each name to be included in the subject alternative name
- * criterion. Each entry is a <code>List</code> whose first entry is an
- * <code>Integer</code> (the name type, 0-8) and whose second
- * entry is a <code>String</code> or a byte array (the name, in
+ * criterion. Each entry is a {@code List} whose first entry is an
+ * {@code Integer} (the name type, 0-8) and whose second
+ * entry is a {@code String} or a byte array (the name, in
* string or ASN.1 DER encoded form, respectively).
* There can be multiple names of the same type. Note that the
- * <code>Collection</code> returned may contain duplicate names (same name
+ * {@code Collection} returned may contain duplicate names (same name
* and name type).
* <p>
- * Each subject alternative name in the <code>Collection</code>
- * may be specified either as a <code>String</code> or as an ASN.1 encoded
+ * Each subject alternative name in the {@code Collection}
+ * may be specified either as a {@code String} or as an ASN.1 encoded
* byte array. For more details about the formats used, see
* {@link #addSubjectAlternativeName(int type, String name)
* addSubjectAlternativeName(int type, String name)} and
* {@link #addSubjectAlternativeName(int type, byte [] name)
* addSubjectAlternativeName(int type, byte [] name)}.
* <p>
- * Note that a deep copy is performed on the <code>Collection</code> to
+ * Note that a deep copy is performed on the {@code Collection} to
* protect against subsequent modifications.
*
- * @return a <code>Collection</code> of names (or <code>null</code>)
+ * @return a {@code Collection} of names (or {@code null})
* @see #setSubjectAlternativeNames
*/
public Collection<List<?>> getSubjectAlternativeNames() {
@@ -1629,21 +1629,21 @@
/**
* Clone an object of the form passed to
* setSubjectAlternativeNames and setPathToNames.
- * Throw a <code>RuntimeException</code> if the argument is malformed.
+ * Throw a {@code RuntimeException} if the argument is malformed.
* <p>
* This method wraps cloneAndCheckNames, changing any
- * <code>IOException</code> into a <code>RuntimeException</code>. This
+ * {@code IOException} into a {@code RuntimeException}. This
* method should be used when the object being
* cloned has already been checked, so there should never be any exceptions.
*
- * @param names a <code>Collection</code> with one entry per name.
- * Each entry is a <code>List</code> whose first entry
+ * @param names a {@code Collection} with one entry per name.
+ * Each entry is a {@code List} whose first entry
* is an Integer (the name type, 0-8) and whose second
* entry is a String or a byte array (the name, in
* string or ASN.1 DER encoded form, respectively).
* There can be multiple names of the same type. Null
* is not an acceptable value.
- * @return a deep copy of the specified <code>Collection</code>
+ * @return a deep copy of the specified {@code Collection}
* @throws RuntimeException if a parsing error occurs
*/
private static Set<List<?>> cloneNames(Collection<List<?>> names) {
@@ -1658,34 +1658,30 @@
/**
* Clone and check an argument of the form passed to
* setSubjectAlternativeNames and setPathToNames.
- * Throw an <code>IOException</code> if the argument is malformed.
+ * Throw an {@code IOException} if the argument is malformed.
*
- * @param names a <code>Collection</code> with one entry per name.
- * Each entry is a <code>List</code> whose first entry
+ * @param names a {@code Collection} with one entry per name.
+ * Each entry is a {@code List} whose first entry
* is an Integer (the name type, 0-8) and whose second
* entry is a String or a byte array (the name, in
* string or ASN.1 DER encoded form, respectively).
* There can be multiple names of the same type.
- * <code>null</code> is not an acceptable value.
- * @return a deep copy of the specified <code>Collection</code>
+ * {@code null} is not an acceptable value.
+ * @return a deep copy of the specified {@code Collection}
* @throws IOException if a parsing error occurs
*/
private static Set<List<?>> cloneAndCheckNames(Collection<List<?>> names) throws IOException {
// Copy the Lists and Collection
Set<List<?>> namesCopy = new HashSet<List<?>>();
- Iterator<List<?>> i = names.iterator();
- while (i.hasNext()) {
- Object o = i.next();
- if (!(o instanceof List)) {
- throw new IOException("expected a List");
- }
- namesCopy.add(new ArrayList<Object>((List<?>)o));
+ for (List<?> o : names)
+ {
+ namesCopy.add(new ArrayList<Object>(o));
}
// Check the contents of the Lists and clone any byte arrays
- i = namesCopy.iterator();
- while (i.hasNext()) {
- List<Object> nameList = (List<Object>)i.next();
+ for (List<?> list : namesCopy) {
+ @SuppressWarnings("unchecked") // See javadoc for parameter "names".
+ List<Object> nameList = (List<Object>)list;
if (nameList.size() != 2) {
throw new IOException("name list size not 2");
}
@@ -1714,7 +1710,7 @@
}
/**
- * Returns the name constraints criterion. The <code>X509Certificate</code>
+ * Returns the name constraints criterion. The {@code X509Certificate}
* must have subject and subject alternative names that
* meet the specified name constraints.
* <p>
@@ -1730,7 +1726,7 @@
*
* @return a byte array containing the ASN.1 DER encoding of
* a NameConstraints extension used for checking name constraints.
- * <code>null</code> if no name constraints check will be performed.
+ * {@code null} if no name constraints check will be performed.
* @see #setNameConstraints
*/
public byte[] getNameConstraints() {
@@ -1743,7 +1739,7 @@
/**
* Returns the basic constraints constraint. If the value is greater than
- * or equal to zero, the <code>X509Certificates</code> must include a
+ * or equal to zero, the {@code X509Certificates} must include a
* basicConstraints extension with a pathLen of at least this value.
* If the value is -2, only end-entity certificates are accepted. If
* the value is -1, no basicConstraints check is done.
@@ -1756,15 +1752,15 @@
}
/**
- * Returns the policy criterion. The <code>X509Certificate</code> must
+ * Returns the policy criterion. The {@code X509Certificate} must
* include at least one of the specified policies in its certificate policies
- * extension. If the <code>Set</code> returned is empty, then the
- * <code>X509Certificate</code> must include at least some specified policy
- * in its certificate policies extension. If the <code>Set</code> returned is
- * <code>null</code>, no policy check will be performed.
+ * extension. If the {@code Set} returned is empty, then the
+ * {@code X509Certificate} must include at least some specified policy
+ * in its certificate policies extension. If the {@code Set} returned is
+ * {@code null}, no policy check will be performed.
*
- * @return an immutable <code>Set</code> of certificate policy OIDs in
- * string format (or <code>null</code>)
+ * @return an immutable {@code Set} of certificate policy OIDs in
+ * string format (or {@code null})
* @see #setPolicy
*/
public Set<String> getPolicy() {
@@ -1773,33 +1769,33 @@
/**
* Returns a copy of the pathToNames criterion. The
- * <code>X509Certificate</code> must not include name constraints that would
+ * {@code X509Certificate} must not include name constraints that would
* prohibit building a path to the specified names. If the value
- * returned is <code>null</code>, no pathToNames check will be performed.
+ * returned is {@code null}, no pathToNames check will be performed.
* <p>
- * If the value returned is not <code>null</code>, it is a
- * <code>Collection</code> with one
+ * If the value returned is not {@code null}, it is a
+ * {@code Collection} with one
* entry for each name to be included in the pathToNames
- * criterion. Each entry is a <code>List</code> whose first entry is an
- * <code>Integer</code> (the name type, 0-8) and whose second
- * entry is a <code>String</code> or a byte array (the name, in
+ * criterion. Each entry is a {@code List} whose first entry is an
+ * {@code Integer} (the name type, 0-8) and whose second
+ * entry is a {@code String} or a byte array (the name, in
* string or ASN.1 DER encoded form, respectively).
* There can be multiple names of the same type. Note that the
- * <code>Collection</code> returned may contain duplicate names (same
+ * {@code Collection} returned may contain duplicate names (same
* name and name type).
* <p>
- * Each name in the <code>Collection</code>
- * may be specified either as a <code>String</code> or as an ASN.1 encoded
+ * Each name in the {@code Collection}
+ * may be specified either as a {@code String} or as an ASN.1 encoded
* byte array. For more details about the formats used, see
* {@link #addPathToName(int type, String name)
* addPathToName(int type, String name)} and
* {@link #addPathToName(int type, byte [] name)
* addPathToName(int type, byte [] name)}.
* <p>
- * Note that a deep copy is performed on the <code>Collection</code> to
+ * Note that a deep copy is performed on the {@code Collection} to
* protect against subsequent modifications.
*
- * @return a <code>Collection</code> of names (or <code>null</code>)
+ * @return a {@code Collection} of names (or {@code null})
* @see #setPathToNames
*/
public Collection<List<?>> getPathToNames() {
@@ -1810,10 +1806,10 @@
}
/**
- * Return a printable representation of the <code>CertSelector</code>.
+ * Return a printable representation of the {@code CertSelector}.
*
- * @return a <code>String</code> describing the contents of the
- * <code>CertSelector</code>
+ * @return a {@code String} describing the contents of the
+ * {@code CertSelector}
*/
public String toString() {
StringBuffer sb = new StringBuffer();
@@ -1932,22 +1928,22 @@
/**
* Returns an Extension object given any X509Certificate and extension oid.
- * Throw an <code>IOException</code> if the extension byte value is
+ * Throw an {@code IOException} if the extension byte value is
* malformed.
*
- * @param cert a <code>X509Certificate</code>
- * @param extId an <code>integer</code> which specifies the extension index.
+ * @param cert a {@code X509Certificate}
+ * @param extId an {@code integer} which specifies the extension index.
* Currently, the supported extensions are as follows:
* index 0 - PrivateKeyUsageExtension
* index 1 - SubjectAlternativeNameExtension
* index 2 - NameConstraintsExtension
* index 3 - CertificatePoliciesExtension
* index 4 - ExtendedKeyUsageExtension
- * @return an <code>Extension</code> object whose real type is as specified
+ * @return an {@code Extension} object whose real type is as specified
* by the extension oid.
- * @throws IOException if cannot construct the <code>Extension</code>
+ * @throws IOException if cannot construct the {@code Extension}
* object with the extension encoding retrieved from the passed in
- * <code>X509Certificate</code>.
+ * {@code X509Certificate}.
*/
private static Extension getExtensionObject(X509Certificate cert, int extId)
throws IOException {
@@ -1995,11 +1991,11 @@
}
/**
- * Decides whether a <code>Certificate</code> should be selected.
+ * Decides whether a {@code Certificate} should be selected.
*
- * @param cert the <code>Certificate</code> to be checked
- * @return <code>true</code> if the <code>Certificate</code> should be
- * selected, <code>false</code> otherwise
+ * @param cert the {@code Certificate} to be checked
+ * @return {@code true} if the {@code Certificate} should be
+ * selected, {@code false} otherwise
*/
public boolean match(Certificate cert) {
if (!(cert instanceof X509Certificate)) {
@@ -2185,8 +2181,7 @@
if (debug != null) {
String time = "n/a";
try {
- Date notAfter =
- (Date)ext.get(PrivateKeyUsageExtension.NOT_AFTER);
+ Date notAfter = ext.get(PrivateKeyUsageExtension.NOT_AFTER);
time = notAfter.toString();
} catch (CertificateException ex) {
// not able to retrieve notAfter value
@@ -2202,8 +2197,7 @@
if (debug != null) {
String time = "n/a";
try {
- Date notBefore = (Date)
- ext.get(PrivateKeyUsageExtension.NOT_BEFORE);
+ Date notBefore = ext.get(PrivateKeyUsageExtension.NOT_BEFORE);
time = notBefore.toString();
} catch (CertificateException ex) {
// not able to retrieve notBefore value
@@ -2245,7 +2239,7 @@
+ subjectPublicKeyAlgID + ", xcert subjectPublicKeyAlgID = "
+ algID.getOID());
}
- if (!subjectPublicKeyAlgID.equals(algID.getOID())) {
+ if (!subjectPublicKeyAlgID.equals((Object)algID.getOID())) {
if (debug != null) {
debug.println("X509CertSelector.match: "
+ "subject public key alg IDs don't match");
@@ -2294,7 +2288,7 @@
EXTENDED_KEY_USAGE_ID);
if (ext != null) {
Vector<ObjectIdentifier> certKeyPurposeVector =
- (Vector<ObjectIdentifier>)ext.get(ExtendedKeyUsageExtension.USAGES);
+ ext.get(ExtendedKeyUsageExtension.USAGES);
if (!certKeyPurposeVector.contains(ANY_EXTENDED_KEY_USAGE)
&& !certKeyPurposeVector.containsAll(keyPurposeOIDSet)) {
if (debug != null) {
@@ -2330,8 +2324,8 @@
}
return false;
}
- GeneralNames certNames = (GeneralNames)
- sanExt.get(SubjectAlternativeNameExtension.SUBJECT_NAME);
+ GeneralNames certNames =
+ sanExt.get(SubjectAlternativeNameExtension.SUBJECT_NAME);
Iterator<GeneralNameInterface> i =
subjectAlternativeGeneralNames.iterator();
while (i.hasNext()) {
@@ -2399,7 +2393,7 @@
}
return false;
}
- List<PolicyInformation> policies = (List<PolicyInformation>)ext.get(CertificatePoliciesExtension.POLICIES);
+ List<PolicyInformation> policies = ext.get(CertificatePoliciesExtension.POLICIES);
/*
* Convert the Vector of PolicyInformation to a Vector
* of CertificatePolicyIds for easier comparison.
@@ -2460,7 +2454,7 @@
if (ext == null) {
return true;
}
- if ((debug != null) && debug.isOn("certpath")) {
+ if ((debug != null) && Debug.isOn("certpath")) {
debug.println("X509CertSelector.match pathToNames:\n");
Iterator<GeneralNameInterface> i =
pathToGeneralNames.iterator();
@@ -2469,10 +2463,10 @@
}
}
- GeneralSubtrees permitted = (GeneralSubtrees)
- ext.get(NameConstraintsExtension.PERMITTED_SUBTREES);
- GeneralSubtrees excluded = (GeneralSubtrees)
- ext.get(NameConstraintsExtension.EXCLUDED_SUBTREES);
+ GeneralSubtrees permitted =
+ ext.get(NameConstraintsExtension.PERMITTED_SUBTREES);
+ GeneralSubtrees excluded =
+ ext.get(NameConstraintsExtension.EXCLUDED_SUBTREES);
if (excluded != null) {
if (matchExcluded(excluded) == false) {
return false;
@@ -2581,8 +2575,10 @@
} else {
if (maxPathLen < basicConstraints) {
if (debug != null) {
- debug.println("X509CertSelector.match: maxPathLen too small ("
- + maxPathLen + " < " + basicConstraints + ")");
+ debug.println("X509CertSelector.match: cert's maxPathLen " +
+ "is less than the min maxPathLen set by " +
+ "basicConstraints. " +
+ "(" + maxPathLen + " < " + basicConstraints + ")");
}
return false;
}
@@ -2590,12 +2586,13 @@
return true;
}
- private static Set<?> cloneSet(Set<?> set) {
+ @SuppressWarnings("unchecked") // Safe casts assuming clone() works correctly
+ private static <T> Set<T> cloneSet(Set<T> set) {
if (set instanceof HashSet) {
- Object clone = ((HashSet<?>)set).clone();
- return (Set<?>)clone;
+ Object clone = ((HashSet<T>)set).clone();
+ return (Set<T>)clone;
} else {
- return new HashSet<Object>(set);
+ return new HashSet<T>(set);
}
}
@@ -2610,22 +2607,18 @@
// Must clone these because addPathToName et al. modify them
if (subjectAlternativeNames != null) {
copy.subjectAlternativeNames =
- (Set<List<?>>)cloneSet(subjectAlternativeNames);
+ cloneSet(subjectAlternativeNames);
copy.subjectAlternativeGeneralNames =
- (Set<GeneralNameInterface>)cloneSet
- (subjectAlternativeGeneralNames);
+ cloneSet(subjectAlternativeGeneralNames);
}
if (pathToGeneralNames != null) {
- copy.pathToNames =
- (Set<List<?>>)cloneSet(pathToNames);
- copy.pathToGeneralNames =
- (Set<GeneralNameInterface>)cloneSet
- (pathToGeneralNames);
+ copy.pathToNames = cloneSet(pathToNames);
+ copy.pathToGeneralNames = cloneSet(pathToGeneralNames);
}
return copy;
} catch (CloneNotSupportedException e) {
/* Cannot happen */
- throw new InternalError(e.toString());
+ throw new InternalError(e.toString(), e);
}
}
}
diff --git a/ojluni/src/main/java/java/security/cert/X509Extension.java b/ojluni/src/main/java/java/security/cert/X509Extension.java
index 6f6c51b..0346960 100644
--- a/ojluni/src/main/java/java/security/cert/X509Extension.java
+++ b/ojluni/src/main/java/java/security/cert/X509Extension.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -59,9 +59,9 @@
* -- the extnId object identifier value
* }
* </pre>
- * Since not all extensions are known, the <code>getExtensionValue</code>
+ * Since not all extensions are known, the {@code getExtensionValue}
* method returns the DER-encoded OCTET STRING of the
- * extension value (i.e., the <code>extnValue</code>). This can then
+ * extension value (i.e., the {@code extnValue}). This can then
* be handled by a <em>Class</em> that understands the extension.
*
* @author Hemma Prafullchandra
@@ -72,8 +72,8 @@
/**
* Check if there is a critical extension that is not supported.
*
- * @return <tt>true</tt> if a critical extension is found that is
- * not supported, otherwise <tt>false</tt>.
+ * @return {@code true} if a critical extension is found that is
+ * not supported, otherwise {@code false}.
*/
public boolean hasUnsupportedCriticalExtension();
@@ -84,18 +84,12 @@
*
* Here is sample code to get a Set of critical extensions from an
* X509Certificate and print the OIDs:
- * <pre><code>
- * InputStream inStrm = null;
+ * <pre>{@code
* X509Certificate cert = null;
- * try {
- * inStrm = new FileInputStream("DER-encoded-Cert");
+ * try (InputStream inStrm = new FileInputStream("DER-encoded-Cert")) {
* CertificateFactory cf = CertificateFactory.getInstance("X.509");
* cert = (X509Certificate)cf.generateCertificate(inStrm);
- * } finally {
- * if (inStrm != null) {
- * inStrm.close();
- * }
- * }<p>
+ * }
*
* Set<String> critSet = cert.getCriticalExtensionOIDs();
* if (critSet != null && !critSet.isEmpty()) {
@@ -104,7 +98,7 @@
* System.out.println(oid);
* }
* }
- * </code></pre>
+ * }</pre>
* @return a Set (or an empty Set if none are marked critical) of
* the extension OID strings for extensions that are marked critical.
* If there are no extensions present at all, then this method returns
@@ -119,35 +113,28 @@
*
* Here is sample code to get a Set of non-critical extensions from an
* X509CRL revoked certificate entry and print the OIDs:
- * <pre><code>
- * InputStream inStrm = null;
+ * <pre>{@code
* CertificateFactory cf = null;
* X509CRL crl = null;
- * try {
- * inStrm = new FileInputStream("DER-encoded-CRL");
+ * try (InputStream inStrm = new FileInputStream("DER-encoded-CRL")) {
* cf = CertificateFactory.getInstance("X.509");
* crl = (X509CRL)cf.generateCRL(inStrm);
- * } finally {
- * if (inStrm != null) {
- * inStrm.close();
- * }
- * }<p>
+ * }
*
- * byte[] certData = <DER-encoded certificate data>
+ * byte[] certData = <DER-encoded certificate data>
* ByteArrayInputStream bais = new ByteArrayInputStream(certData);
* X509Certificate cert = (X509Certificate)cf.generateCertificate(bais);
- * bais.close();
* X509CRLEntry badCert =
- * crl.getRevokedCertificate(cert.getSerialNumber());<p>
+ * crl.getRevokedCertificate(cert.getSerialNumber());
*
* if (badCert != null) {
- * Set<String> nonCritSet = badCert.getNonCriticalExtensionOIDs();<p>
+ * Set<String> nonCritSet = badCert.getNonCriticalExtensionOIDs();
* if (nonCritSet != null)
* for (String oid : nonCritSet) {
* System.out.println(oid);
* }
* }
- * </code></pre>
+ * }</pre>
*
* @return a Set (or an empty Set if none are marked non-critical) of
* the extension OID strings for extensions that are marked non-critical.
@@ -158,9 +145,9 @@
/**
* Gets the DER-encoded OCTET string for the extension value
- * (<em>extnValue</em>) identified by the passed-in <code>oid</code>
+ * (<em>extnValue</em>) identified by the passed-in {@code oid}
* String.
- * The <code>oid</code> string is
+ * The {@code oid} string is
* represented by a set of nonnegative whole numbers separated
* by periods.
*
diff --git a/ojluni/src/main/java/java/security/cert/package-info.java b/ojluni/src/main/java/java/security/cert/package-info.java
new file mode 100644
index 0000000..0ef896b
--- /dev/null
+++ b/ojluni/src/main/java/java/security/cert/package-info.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides classes and interfaces for parsing and managing
+ * certificates, certificate revocation lists (CRLs), and
+ * certification paths. It contains support for X.509 v3
+ * certificates and X.509 v2 CRLs.
+ *
+ * <h2>Package Specification</h2>
+ *
+ * <ul>
+ * <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html">
+ * <b>Java™
+ * Cryptography Architecture (JCA) Reference Guide</b></a>
+ * <li>RFC 5280: Internet X.509 Public Key Infrastructure Certificate and
+ * Certificate Revocation List (CRL) Profile
+ * <li>RFC 2560: X.509 Internet Public Key Infrastructure Online Certificate
+ * Status Protocol - OCSP
+ * <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html">
+ * <b>Java™
+ * Cryptography Architecture Standard Algorithm Name
+ * Documentation</b></a></li>
+ * </ul>
+ *
+ * <h2>Related Documentation</h2>
+ *
+ * For information about X.509 certificates and CRLs, please see:
+ * <ul>
+ * <li><a href="http://www.ietf.org/rfc/rfc5280.txt">
+ * http://www.ietf.org/rfc/rfc5280.txt</a>
+ * <li><a href=
+ * "{@docRoot}/../technotes/guides/security/certpath/CertPathProgGuide.html">
+ * <b>Java™
+ * PKI Programmer's Guide</b></a>
+ * <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/cert3.html">
+ * <b>X.509 Certificates and Certificate Revocation Lists (CRLs)</b></a>
+ * </ul>
+ *
+ * @since 1.2
+ */
+package java.security.cert;
diff --git a/ojluni/src/main/java/java/security/cert/package.html b/ojluni/src/main/java/java/security/cert/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/interfaces/DSAKeyPairGenerator.java b/ojluni/src/main/java/java/security/interfaces/DSAKeyPairGenerator.java
index d86bbbc..e50cfd2 100644
--- a/ojluni/src/main/java/java/security/interfaces/DSAKeyPairGenerator.java
+++ b/ojluni/src/main/java/java/security/interfaces/DSAKeyPairGenerator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,8 +30,8 @@
/**
* An interface to an object capable of generating DSA key pairs.
*
- * <p>The <code>initialize</code> methods may each be called any number
- * of times. If no <code>initialize</code> method is called on a
+ * <p>The {@code initialize} methods may each be called any number
+ * of times. If no {@code initialize} method is called on a
* DSAKeyPairGenerator, the default is to generate 1024-bit keys, using
* precomputed p, q and g parameters and an instance of SecureRandom as
* the random bit source.
@@ -42,26 +42,29 @@
* <ol>
*
* <li>Get a key pair generator for the DSA algorithm by calling the
- * KeyPairGenerator <code>getInstance</code> method with "DSA"
- * as its argument.<p>
+ * KeyPairGenerator {@code getInstance} method with "DSA"
+ * as its argument.
*
* <li>Initialize the generator by casting the result to a DSAKeyPairGenerator
* and calling one of the
- * <code>initialize</code> methods from this DSAKeyPairGenerator interface.<p>
+ * {@code initialize} methods from this DSAKeyPairGenerator interface.
*
- * <li>Generate a key pair by calling the <code>generateKeyPair</code>
+ * <li>Generate a key pair by calling the {@code generateKeyPair}
* method from the KeyPairGenerator class.
*
* </ol>
*
* <p>Note: it is not always necessary to do do algorithm-specific
* initialization for a DSA key pair generator. That is, it is not always
- * necessary to call an <code>initialize</code> method in this interface.
- * Algorithm-independent initialization using the <code>initialize</code> method
+ * necessary to call an {@code initialize} method in this interface.
+ * Algorithm-independent initialization using the {@code initialize} method
* in the KeyPairGenerator
* interface is all that is needed when you accept defaults for algorithm-specific
* parameters.
*
+ * <p>Note: Some earlier implementations of this interface may not support
+ * larger sizes of DSA parameters such as 2048 and 3072-bit.
+ *
* @see java.security.KeyPairGenerator
*/
public interface DSAKeyPairGenerator {
@@ -77,8 +80,8 @@
* @param random the random bit source to use to generate key bits;
* can be null.
*
- * @exception InvalidParameterException if the <code>params</code>
- * value is invalid or null.
+ * @exception InvalidParameterException if the {@code params}
+ * value is invalid, null, or unsupported.
*/
public void initialize(DSAParams params, SecureRandom random)
throws InvalidParameterException;
@@ -89,7 +92,7 @@
* If a SecureRandom bit source is needed but not supplied, i.e.
* null, a default SecureRandom instance will be used.
*
- * <p>If <code>genParams</code> is true, this method generates new
+ * <p>If {@code genParams} is true, this method generates new
* p, q and g parameters. If it is false, the method uses precomputed
* parameters for the modulus length requested. If there are no
* precomputed parameters for that modulus length, an exception will be
@@ -97,7 +100,7 @@
* default parameters for modulus lengths of 512 and 1024 bits.
*
* @param modlen the modulus length in bits. Valid values are any
- * multiple of 8 between 512 and 1024, inclusive.
+ * multiple of 64 between 512 and 1024, inclusive, 2048, and 3072.
*
* @param random the random bit source to use to generate key bits;
* can be null.
@@ -105,10 +108,9 @@
* @param genParams whether or not to generate new parameters for
* the modulus length requested.
*
- * @exception InvalidParameterException if <code>modlen</code> is not
- * between 512 and 1024, or if <code>genParams</code> is false and
- * there are no precomputed parameters for the requested modulus
- * length.
+ * @exception InvalidParameterException if {@code modlen} is
+ * invalid, or unsupported, or if {@code genParams} is false and there
+ * are no precomputed parameters for the requested modulus length.
*/
public void initialize(int modlen, boolean genParams, SecureRandom random)
throws InvalidParameterException;
diff --git a/ojluni/src/main/java/java/security/interfaces/DSAParams.java b/ojluni/src/main/java/java/security/interfaces/DSAParams.java
index f20b8ec..b672ad5 100644
--- a/ojluni/src/main/java/java/security/interfaces/DSAParams.java
+++ b/ojluni/src/main/java/java/security/interfaces/DSAParams.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -42,23 +42,23 @@
public interface DSAParams {
/**
- * Returns the prime, <code>p</code>.
+ * Returns the prime, {@code p}.
*
- * @return the prime, <code>p</code>.
+ * @return the prime, {@code p}.
*/
public BigInteger getP();
/**
- * Returns the subprime, <code>q</code>.
+ * Returns the subprime, {@code q}.
*
- * @return the subprime, <code>q</code>.
+ * @return the subprime, {@code q}.
*/
public BigInteger getQ();
/**
- * Returns the base, <code>g</code>.
+ * Returns the base, {@code g}.
*
- * @return the base, <code>g</code>.
+ * @return the base, {@code g}.
*/
public BigInteger getG();
}
diff --git a/ojluni/src/main/java/java/security/interfaces/DSAPrivateKey.java b/ojluni/src/main/java/java/security/interfaces/DSAPrivateKey.java
index a0d1893..81ab358 100644
--- a/ojluni/src/main/java/java/security/interfaces/DSAPrivateKey.java
+++ b/ojluni/src/main/java/java/security/interfaces/DSAPrivateKey.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -50,9 +50,9 @@
static final long serialVersionUID = 7776497482533790279L;
/**
- * Returns the value of the private key, <code>x</code>.
+ * Returns the value of the private key, {@code x}.
*
- * @return the value of the private key, <code>x</code>.
+ * @return the value of the private key, {@code x}.
*/
public BigInteger getX();
}
diff --git a/ojluni/src/main/java/java/security/interfaces/DSAPublicKey.java b/ojluni/src/main/java/java/security/interfaces/DSAPublicKey.java
index b273738..e56b795 100644
--- a/ojluni/src/main/java/java/security/interfaces/DSAPublicKey.java
+++ b/ojluni/src/main/java/java/security/interfaces/DSAPublicKey.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -50,9 +50,9 @@
static final long serialVersionUID = 1234526332779022332L;
/**
- * Returns the value of the public key, <code>y</code>.
+ * Returns the value of the public key, {@code y}.
*
- * @return the value of the public key, <code>y</code>.
+ * @return the value of the public key, {@code y}.
*/
public BigInteger getY();
}
diff --git a/ojluni/src/main/java/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java b/ojluni/src/main/java/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java
index 19cddce..f85d96a 100644
--- a/ojluni/src/main/java/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java
+++ b/ojluni/src/main/java/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -46,6 +46,11 @@
public interface RSAMultiPrimePrivateCrtKey extends RSAPrivateKey {
+ /**
+ * The type fingerprint that is set to indicate
+ * serialization compatibility with a previous
+ * version of the type.
+ */
static final long serialVersionUID = 618058533534628008L;
/**
diff --git a/ojluni/src/main/java/java/security/interfaces/RSAPrivateCrtKey.java b/ojluni/src/main/java/java/security/interfaces/RSAPrivateCrtKey.java
index 670af46..0408fea 100644
--- a/ojluni/src/main/java/java/security/interfaces/RSAPrivateCrtKey.java
+++ b/ojluni/src/main/java/java/security/interfaces/RSAPrivateCrtKey.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,11 @@
public interface RSAPrivateCrtKey extends RSAPrivateKey {
+ /**
+ * The type fingerprint that is set to indicate
+ * serialization compatibility with a previous
+ * version of the type.
+ */
static final long serialVersionUID = -5682214253527700368L;
/**
diff --git a/ojluni/src/main/java/java/security/interfaces/RSAPrivateKey.java b/ojluni/src/main/java/java/security/interfaces/RSAPrivateKey.java
index 522c5ba..5d69ad6 100644
--- a/ojluni/src/main/java/java/security/interfaces/RSAPrivateKey.java
+++ b/ojluni/src/main/java/java/security/interfaces/RSAPrivateKey.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,11 @@
public interface RSAPrivateKey extends java.security.PrivateKey, RSAKey
{
+ /**
+ * The type fingerprint that is set to indicate
+ * serialization compatibility with a previous
+ * version of the type.
+ */
static final long serialVersionUID = 5187144804936595022L;
/**
diff --git a/ojluni/src/main/java/java/security/interfaces/RSAPublicKey.java b/ojluni/src/main/java/java/security/interfaces/RSAPublicKey.java
index 04d80cf..a698c05 100644
--- a/ojluni/src/main/java/java/security/interfaces/RSAPublicKey.java
+++ b/ojluni/src/main/java/java/security/interfaces/RSAPublicKey.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,11 @@
public interface RSAPublicKey extends java.security.PublicKey, RSAKey
{
+ /**
+ * The type fingerprint that is set to indicate
+ * serialization compatibility with a previous
+ * version of the type.
+ */
static final long serialVersionUID = -8727434096241101194L;
/**
diff --git a/ojluni/src/main/java/java/security/interfaces/package-info.java b/ojluni/src/main/java/java/security/interfaces/package-info.java
new file mode 100644
index 0000000..a2d77da
--- /dev/null
+++ b/ojluni/src/main/java/java/security/interfaces/package-info.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides interfaces for generating RSA (Rivest, Shamir and
+ * Adleman AsymmetricCipher algorithm)
+ * keys as defined in the RSA Laboratory Technical Note
+ * PKCS#1, and DSA (Digital Signature
+ * Algorithm) keys as defined in NIST's FIPS-186.
+ * <P>
+ * Note that these interfaces are intended only for key
+ * implementations whose key material is accessible and
+ * available. These interfaces are not intended for key
+ * implementations whose key material resides in
+ * inaccessible, protected storage (such as in a
+ * hardware device).
+ * <P>
+ * For more developer information on how to use these
+ * interfaces, including information on how to design
+ * {@code Key} classes for hardware devices, please refer
+ * to these cryptographic provider developer guides:
+ * <ul>
+ * <li><a href=
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/HowToImplAProvider.html">
+ * <b>How to Implement a Provider for the
+ * Java™ Cryptography Architecture
+ * </b></a></li>
+ * </ul>
+ *
+ * <h2>Package Specification</h2>
+ *
+ * <ul>
+ * <li>PKCS #1: RSA Encryption Standard, Version 1.5, November 1993 </li>
+ * <li>Federal Information Processing Standards Publication (FIPS PUB) 186:
+ * Digital Signature Standard (DSS) </li>
+ * </ul>
+ *
+ * <h2>Related Documentation</h2>
+ *
+ * For further documentation, please see:
+ * <ul>
+ * <li>
+ * <a href=
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html">
+ * <b>Java™
+ * Cryptography Architecture API Specification and Reference
+ * </b></a></li>
+ * </ul>
+ *
+ * @since JDK1.1
+ */
+package java.security.interfaces;
diff --git a/ojluni/src/main/java/java/security/interfaces/package.html b/ojluni/src/main/java/java/security/interfaces/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/package-info.java b/ojluni/src/main/java/java/security/package-info.java
new file mode 100644
index 0000000..376aa9d
--- /dev/null
+++ b/ojluni/src/main/java/java/security/package-info.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Provides the classes and interfaces for the security framework.
+ * This includes classes that implement an easily configurable,
+ * fine-grained access control security architecture.
+ * This package also supports
+ * the generation and storage of cryptographic public key pairs,
+ * as well as a number of exportable cryptographic operations
+ * including those for message digest and signature generation. Finally,
+ * this package provides classes that support signed/guarded objects
+ * and secure random number generation.
+ *
+ * Many of the classes provided in this package (the cryptographic
+ * and secure random number generator classes in particular) are
+ * provider-based. The class itself defines a programming interface
+ * to which applications may write. The implementations themselves may
+ * then be written by independent third-party vendors and plugged
+ * in seamlessly as needed. Therefore application developers may
+ * take advantage of any number of provider-based implementations
+ * without having to add or rewrite code.
+ *
+ * <h2>Package Specification</h2>
+ *
+ * <ul>
+ * <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/../technotes/guides/security/crypto/CryptoSpec.html">
+ * <b>Java™
+ * Cryptography Architecture (JCA) Reference Guide</b></a></li>
+ *
+ * <li>PKCS #8: Private-Key Information Syntax Standard, Version 1.2,
+ * November 1993</li>
+ *
+ * <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/../technotes/guides/security/StandardNames.html">
+ * <b>Java™
+ * Cryptography Architecture Standard Algorithm Name
+ * Documentation</b></a></li>
+ * </ul>
+ *
+ * <h2>Related Documentation</h2>
+ *
+ * For further documentation, please see:
+ * <ul>
+ * <li><a href=
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/../technotes/guides/security/spec/security-spec.doc.html">
+ * <b>Java™
+ * SE Platform Security Architecture</b></a></li>
+ *
+ * <li><a href=
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/../technotes/guides/security/crypto/HowToImplAProvider.html">
+ * <b>How to Implement a Provider in the
+ * Java™ Cryptography Architecture
+ * </b></a></li>
+ *
+ * <li><a href=
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/../technotes/guides/security/PolicyFiles.html"><b>
+ * Default Policy Implementation and Policy File Syntax
+ * </b></a></li>
+ *
+ * <li><a href=
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/../technotes/guides/security/permissions.html"><b>
+ * Permissions in the
+ * Java™ SE Development Kit (JDK)
+ * </b></a></li>
+ *
+ * <li><a href=
+ * "{@docRoot}openjdk-redirect.html?v=8&path=/../technotes/guides/security/SecurityToolsSummary.html"><b>
+ * Summary of Tools for
+ * Java™ Platform Security
+ * </b></a></li>
+ *
+ * <li><b>keytool</b>
+ * (<a href="{@docRoot}openjdk-redirect.html?v=8&path=/../technotes/tools/unix/keytool.html">
+ * for Solaris/Linux</a>)
+ * (<a href="{@docRoot}openjdk-redirect.html?v=8&path=/../technotes/tools/windows/keytool.html">
+ * for Windows</a>)
+ * </li>
+ *
+ * <li><b>jarsigner</b>
+ * (<a href="{@docRoot}openjdk-redirect.html?v=8&path=/../technotes/tools/unix/jarsigner.html">
+ * for Solaris/Linux</a>)
+ * (<a href="{@docRoot}openjdk-redirect.html?v=8&path=/../technotes/tools/windows/jarsigner.html">
+ * for Windows</a>)
+ * </li>
+ *
+ * </ul>
+ *
+ * @since 1.1
+ */
+package java.security;
diff --git a/ojluni/src/main/java/java/security/package.html b/ojluni/src/main/java/java/security/package.html
deleted file mode 100755
index 52d427a..0000000
--- a/ojluni/src/main/java/java/security/package.html
+++ /dev/null
@@ -1,117 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation. Oracle designates this
-particular file as subject to the "Classpath" exception as provided
-by Oracle in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-or visit www.oracle.com if you need additional information or have any
-questions.
--->
-
-</head>
-<body bgcolor="white">
-
-Provides the classes and interfaces for the security framework.
-This includes classes that implement an easily configurable,
-fine-grained access control security architecture.
-This package also supports
-the generation and storage of cryptographic public key pairs,
-as well as a number of exportable cryptographic operations
-including those for message digest and signature generation. Finally,
-this package provides classes that support signed/guarded objects
-and secure random number generation.
-
-Many of the classes provided in this package (the cryptographic
-and secure random number generator classes in particular) are
-provider-based. The class itself defines a programming interface
-to which applications may write. The implementations themselves may
-then be written by independent third-party vendors and plugged
-in seamlessly as needed. Therefore application developers may
-take advantage of any number of provider-based implementations
-without having to add or rewrite code.
-
-<h2>Package Specification</h2>
-
-<ul>
- <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/CryptoSpec.html">
- <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
- Cryptography Architecture (JCA) Reference Guide</b></a></li>
-
- <li>PKCS #8: Private-Key Information Syntax Standard, Version 1.2,
- November 1993</li>
-
- <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html">
- <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
- Cryptography Architecture Standard Algorithm Name
- Documentation</b></a></li>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For further documentation, please see:
-<ul>
- <li><a href=
- "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/spec/security-spec.doc.html">
- <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
- SE Platform Security Architecture</b></a></li>
-
- <li><a href=
- "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/crypto/HowToImplAProvider.html">
- <b>How to Implement a Provider in the
- Java<FONT SIZE=-2><SUP>TM</SUP></FONT> Cryptography Architecture
- </b></a></li>
-
- <li><a href=
- "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/PolicyFiles.html"><b>
- Default Policy Implementation and Policy File Syntax
- </b></a></li>
-
- <li><a href=
- "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/permissions.html"><b>
- Permissions in the
- Java<FONT SIZE=-2><SUP>TM</SUP></FONT> SE Development Kit (JDK)
- </b></a></li>
-
- <li><a href=
- "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/SecurityToolsSummary.html"><b>
- Summary of Tools for
- Java<FONT SIZE=-2><SUP>TM</SUP></FONT> Platform Security
- </b></a></li>
-
- <li><b>keytool</b>
- (<a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/tools/solaris/keytool.html">
- for Solaris/Linux</a>)
- (<a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/tools/windows/keytool.html">
- for Windows</a>)
- </li>
-
- <li><b>jarsigner</b>
- (<a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/tools/solaris/jarsigner.html">
- for Solaris/Linux</a>)
- (<a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/tools/windows/jarsigner.html">
- for Windows</a>)
- </li>
-
-</ul>
-
-@since 1.1
-</body>
-</html>
diff --git a/ojluni/src/main/java/java/security/spec/package.html b/ojluni/src/main/java/java/security/spec/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/package.html b/ojluni/src/main/java/java/sql/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/package.html b/ojluni/src/main/java/java/text/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/spi/package.html b/ojluni/src/main/java/java/text/spi/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/jar/package.html b/ojluni/src/main/java/java/util/jar/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/logging/package.html b/ojluni/src/main/java/java/util/logging/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/package.html b/ojluni/src/main/java/java/util/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/prefs/package.html b/ojluni/src/main/java/java/util/prefs/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/regex/package.html b/ojluni/src/main/java/java/util/regex/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/spi/package.html b/ojluni/src/main/java/java/util/spi/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/package.html b/ojluni/src/main/java/java/util/zip/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/interfaces/package.html b/ojluni/src/main/java/javax/crypto/interfaces/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/package.html b/ojluni/src/main/java/javax/crypto/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/spec/package.html b/ojluni/src/main/java/javax/crypto/spec/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/package.html b/ojluni/src/main/java/javax/net/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/package.html b/ojluni/src/main/java/javax/net/ssl/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/sql/package.html b/ojluni/src/main/java/javax/sql/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/sql/rowset/package.html b/ojluni/src/main/java/javax/sql/rowset/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/reflect/package.html b/ojluni/src/main/java/sun/reflect/package.html
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/pkcs/PKCS7.java b/ojluni/src/main/java/sun/security/pkcs/PKCS7.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/DerInputBuffer.java b/ojluni/src/main/java/sun/security/util/DerInputBuffer.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/DerInputStream.java b/ojluni/src/main/java/sun/security/util/DerInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/DerValue.java b/ojluni/src/main/java/sun/security/util/DerValue.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/AccessDescription.java b/ojluni/src/main/java/sun/security/x509/AccessDescription.java
index fd05f28..fbf4bed 100644
--- a/ojluni/src/main/java/sun/security/x509/AccessDescription.java
+++ b/ojluni/src/main/java/sun/security/x509/AccessDescription.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,6 @@
package sun.security.x509;
-import java.security.cert.*;
import java.io.IOException;
import sun.security.util.*;
@@ -96,19 +95,19 @@
if (this == that) {
return true;
}
- return (accessMethod.equals(that.getAccessMethod()) &&
+ return (accessMethod.equals((Object)that.getAccessMethod()) &&
accessLocation.equals(that.getAccessLocation()));
}
public String toString() {
String method = null;
- if (accessMethod.equals(Ad_CAISSUERS_Id)) {
+ if (accessMethod.equals((Object)Ad_CAISSUERS_Id)) {
method = "caIssuers";
- } else if (accessMethod.equals(Ad_CAREPOSITORY_Id)) {
+ } else if (accessMethod.equals((Object)Ad_CAREPOSITORY_Id)) {
method = "caRepository";
- } else if (accessMethod.equals(Ad_TIMESTAMPING_Id)) {
+ } else if (accessMethod.equals((Object)Ad_TIMESTAMPING_Id)) {
method = "timeStamping";
- } else if (accessMethod.equals(Ad_OCSP_Id)) {
+ } else if (accessMethod.equals((Object)Ad_OCSP_Id)) {
method = "ocsp";
} else {
method = accessMethod.toString();
diff --git a/ojluni/src/main/java/sun/security/x509/AuthorityInfoAccessExtension.java b/ojluni/src/main/java/sun/security/x509/AuthorityInfoAccessExtension.java
index 0247f34..725c753 100644
--- a/ojluni/src/main/java/sun/security/x509/AuthorityInfoAccessExtension.java
+++ b/ojluni/src/main/java/sun/security/x509/AuthorityInfoAccessExtension.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -163,6 +163,7 @@
/**
* Set the attribute value.
*/
+ @SuppressWarnings("unchecked") // Checked with an instanceof check
public void set(String name, Object obj) throws IOException {
if (name.equalsIgnoreCase(DESCRIPTIONS)) {
if (!(obj instanceof List)) {
@@ -180,7 +181,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public List<AccessDescription> get(String name) throws IOException {
if (name.equalsIgnoreCase(DESCRIPTIONS)) {
return accessDescriptions;
} else {
diff --git a/ojluni/src/main/java/sun/security/x509/CRLExtensions.java b/ojluni/src/main/java/sun/security/x509/CRLExtensions.java
index dc1fc71..5e7f42d 100644
--- a/ojluni/src/main/java/sun/security/x509/CRLExtensions.java
+++ b/ojluni/src/main/java/sun/security/x509/CRLExtensions.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
@@ -38,7 +38,6 @@
import java.util.TreeMap;
import sun.security.util.*;
-import sun.misc.HexDumpEncoder;
/**
* This class defines the CRL Extensions.
@@ -112,7 +111,7 @@
// Parse the encoded extension
private void parseExtension(Extension ext) throws CRLException {
try {
- Class extClass = OIDMap.getClass(ext.getExtensionId());
+ Class<?> extClass = OIDMap.getClass(ext.getExtensionId());
if (extClass == null) { // Unsupported extension
if (ext.isCritical())
unsupportedCritExt = true;
@@ -120,10 +119,10 @@
throw new CRLException("Duplicate extensions not allowed");
return;
}
- Constructor cons = ((Class<?>)extClass).getConstructor(PARAMS);
+ Constructor<?> cons = extClass.getConstructor(PARAMS);
Object[] passed = new Object[] {Boolean.valueOf(ext.isCritical()),
ext.getExtensionValue()};
- CertAttrSet crlExt = (CertAttrSet)cons.newInstance(passed);
+ CertAttrSet<?> crlExt = (CertAttrSet<?>)cons.newInstance(passed);
if (map.put(crlExt.getName(), (Extension)crlExt) != null) {
throw new CRLException("Duplicate extensions not allowed");
}
diff --git a/ojluni/src/main/java/sun/security/x509/CRLNumberExtension.java b/ojluni/src/main/java/sun/security/x509/CRLNumberExtension.java
index 342b4a9..9649df6 100644
--- a/ojluni/src/main/java/sun/security/x509/CRLNumberExtension.java
+++ b/ojluni/src/main/java/sun/security/x509/CRLNumberExtension.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -155,7 +155,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public BigInteger get(String name) throws IOException {
if (name.equalsIgnoreCase(NUMBER)) {
if (crlNumber == null) return null;
else return crlNumber;
diff --git a/ojluni/src/main/java/sun/security/x509/CRLReasonCodeExtension.java b/ojluni/src/main/java/sun/security/x509/CRLReasonCodeExtension.java
index 6bbb383..5212b0e 100644
--- a/ojluni/src/main/java/sun/security/x509/CRLReasonCodeExtension.java
+++ b/ojluni/src/main/java/sun/security/x509/CRLReasonCodeExtension.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -34,29 +34,9 @@
/**
* The reasonCode is a non-critical CRL entry extension that identifies
- * the reason for the certificate revocation. CAs are strongly
- * encouraged to include reason codes in CRL entries; however, the
- * reason code CRL entry extension should be absent instead of using the
- * unspecified (0) reasonCode value.
- * <p>The ASN.1 syntax for this is:
- * <pre>
- * id-ce-cRLReason OBJECT IDENTIFIER ::= { id-ce 21 }
- *
- * -- reasonCode ::= { CRLReason }
- *
- * CRLReason ::= ENUMERATED {
- * unspecified (0),
- * keyCompromise (1),
- * cACompromise (2),
- * affiliationChanged (3),
- * superseded (4),
- * cessationOfOperation (5),
- * certificateHold (6),
- * removeFromCRL (8),
- * privilegeWithdrawn (9),
- * aACompromise (10) }
- * </pre>
+ * the reason for the certificate revocation.
* @author Hemma Prafullchandra
+ * @see java.security.cert.CRLReason
* @see Extension
* @see CertAttrSet
*/
@@ -64,23 +44,11 @@
implements CertAttrSet<String> {
/**
- * Attribute name and Reason codes
+ * Attribute name
*/
public static final String NAME = "CRLReasonCode";
public static final String REASON = "reason";
- public static final int UNSPECIFIED = 0;
- public static final int KEY_COMPROMISE = 1;
- public static final int CA_COMPROMISE = 2;
- public static final int AFFLIATION_CHANGED = 3;
- public static final int SUPERSEDED = 4;
- public static final int CESSATION_OF_OPERATION = 5;
- public static final int CERTIFICATE_HOLD = 6;
- // note 7 missing in syntax
- public static final int REMOVE_FROM_CRL = 8;
- public static final int PRIVILEGE_WITHDRAWN = 9;
- public static final int AA_COMPROMISE = 10;
-
private static CRLReason[] values = CRLReason.values();
private int reasonCode = 0;
@@ -155,7 +123,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public Integer get(String name) throws IOException {
if (name.equalsIgnoreCase(REASON)) {
return new Integer(reasonCode);
} else {
@@ -181,7 +149,7 @@
* Returns a printable representation of the Reason code.
*/
public String toString() {
- return super.toString() + " Reason Code: " + values[reasonCode];
+ return super.toString() + " Reason Code: " + getReasonCode();
}
/**
diff --git a/ojluni/src/main/java/sun/security/x509/CertificateAlgorithmId.java b/ojluni/src/main/java/sun/security/x509/CertificateAlgorithmId.java
index 5efdb40..a7d6e25 100644
--- a/ojluni/src/main/java/sun/security/x509/CertificateAlgorithmId.java
+++ b/ojluni/src/main/java/sun/security/x509/CertificateAlgorithmId.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -130,7 +130,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public AlgorithmId get(String name) throws IOException {
if (name.equalsIgnoreCase(ALGORITHM)) {
return (algId);
} else {
diff --git a/ojluni/src/main/java/sun/security/x509/CertificateExtensions.java b/ojluni/src/main/java/sun/security/x509/CertificateExtensions.java
index 65dcff1..75d5ae3 100644
--- a/ojluni/src/main/java/sun/security/x509/CertificateExtensions.java
+++ b/ojluni/src/main/java/sun/security/x509/CertificateExtensions.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2009, 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
@@ -94,7 +94,7 @@
// Parse the encoded extension
private void parseExtension(Extension ext) throws IOException {
try {
- Class extClass = OIDMap.getClass(ext.getExtensionId());
+ Class<?> extClass = OIDMap.getClass(ext.getExtensionId());
if (extClass == null) { // Unsupported extension
if (ext.isCritical()) {
unsupportedCritExt = true;
@@ -105,11 +105,12 @@
throw new IOException("Duplicate extensions not allowed");
}
}
- Constructor cons = ((Class<?>)extClass).getConstructor(PARAMS);
+ Constructor<?> cons = extClass.getConstructor(PARAMS);
Object[] passed = new Object[] {Boolean.valueOf(ext.isCritical()),
ext.getExtensionValue()};
- CertAttrSet certExt = (CertAttrSet)cons.newInstance(passed);
+ CertAttrSet<?> certExt = (CertAttrSet<?>)
+ cons.newInstance(passed);
if (map.put(certExt.getName(), (Extension)certExt) != null) {
throw new IOException("Duplicate extensions not allowed");
}
@@ -133,12 +134,12 @@
if (e instanceof IOException) {
throw (IOException)e;
} else {
- throw (IOException)new IOException(e.toString()).initCause(e);
+ throw new IOException(e);
}
} catch (IOException e) {
throw e;
} catch (Exception e) {
- throw (IOException)new IOException(e.toString()).initCause(e);
+ throw new IOException(e);
}
}
@@ -211,8 +212,8 @@
* @param name the extension name used in the lookup.
* @exception IOException if named extension is not found.
*/
- public Object get(String name) throws IOException {
- Object obj = map.get(name);
+ public Extension get(String name) throws IOException {
+ Extension obj = map.get(name);
if (obj == null) {
throw new IOException("No extension found with name " + name);
}
@@ -240,7 +241,7 @@
public String getNameByOid(ObjectIdentifier oid) throws IOException {
for (String name: map.keySet()) {
- if (map.get(name).getExtensionId().equals(oid)) {
+ if (map.get(name).getExtensionId().equals((Object)oid)) {
return name;
}
}
@@ -360,7 +361,7 @@
name = "";
try {
- Class extClass = OIDMap.getClass(ext.getExtensionId());
+ Class<?> extClass = OIDMap.getClass(ext.getExtensionId());
if (extClass != null) {
Field field = extClass.getDeclaredField("NAME");
name = (String)(field.get(null)) + " ";
diff --git a/ojluni/src/main/java/sun/security/x509/CertificateIssuerExtension.java b/ojluni/src/main/java/sun/security/x509/CertificateIssuerExtension.java
index 23676d7..b773970 100644
--- a/ojluni/src/main/java/sun/security/x509/CertificateIssuerExtension.java
+++ b/ojluni/src/main/java/sun/security/x509/CertificateIssuerExtension.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -141,7 +141,7 @@
*
* @throws IOException on error
*/
- public Object get(String name) throws IOException {
+ public GeneralNames get(String name) throws IOException {
if (name.equalsIgnoreCase(ISSUER)) {
return names;
} else {
diff --git a/ojluni/src/main/java/sun/security/x509/CertificateIssuerUniqueIdentity.java b/ojluni/src/main/java/sun/security/x509/CertificateIssuerUniqueIdentity.java
deleted file mode 100644
index cf3bfd8..0000000
--- a/ojluni/src/main/java/sun/security/x509/CertificateIssuerUniqueIdentity.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.security.x509;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Enumeration;
-
-import sun.security.util.*;
-
-/**
- * This class defines the subject/issuer unique identity attribute
- * for the Certificate.
- *
- * @author Amit Kapoor
- * @author Hemma Prafullchandra
- * @see CertAttrSet
- */
-public class CertificateIssuerUniqueIdentity implements CertAttrSet<String> {
- private UniqueIdentity id;
-
- /**
- * Identifier for this attribute, to be used with the
- * get, set, delete methods of Certificate, x509 type.
- */
- public static final String IDENT = "x509.info.issuerID";
- /**
- * Sub attributes name for this CertAttrSet.
- */
- public static final String NAME = "issuerID";
- public static final String ID = "id";
-
- /**
- * Default constructor for the certificate attribute.
- *
- * @param key the UniqueIdentity
- */
- public CertificateIssuerUniqueIdentity(UniqueIdentity id) {
- this.id = id;
- }
-
- /**
- * Create the object, decoding the values from the passed DER stream.
- *
- * @param in the DerInputStream to read the UniqueIdentity from.
- * @exception IOException on decoding errors.
- */
- public CertificateIssuerUniqueIdentity(DerInputStream in)
- throws IOException {
- id = new UniqueIdentity(in);
- }
-
- /**
- * Create the object, decoding the values from the passed stream.
- *
- * @param in the InputStream to read the UniqueIdentity from.
- * @exception IOException on decoding errors.
- */
- public CertificateIssuerUniqueIdentity(InputStream in)
- throws IOException {
- DerValue val = new DerValue(in);
- id = new UniqueIdentity(val);
- }
-
- /**
- * Create the object, decoding the values from the passed DER value.
- *
- * @param in the DerValue to read the UniqueIdentity from.
- * @exception IOException on decoding errors.
- */
- public CertificateIssuerUniqueIdentity(DerValue val)
- throws IOException {
- id = new UniqueIdentity(val);
- }
-
- /**
- * Return the identity as user readable string.
- */
- public String toString() {
- if (id == null) return "";
- return (id.toString());
- }
-
- /**
- * Encode the identity in DER form to the stream.
- *
- * @param out the DerOutputStream to marshal the contents to.
- * @exception IOException on errors.
- */
- public void encode(OutputStream out) throws IOException {
- DerOutputStream tmp = new DerOutputStream();
- id.encode(tmp,DerValue.createTag(DerValue.TAG_CONTEXT,false,(byte)1));
-
- out.write(tmp.toByteArray());
- }
-
- /**
- * Set the attribute value.
- */
- public void set(String name, Object obj) throws IOException {
- if (!(obj instanceof UniqueIdentity)) {
- throw new IOException("Attribute must be of type UniqueIdentity.");
- }
- if (name.equalsIgnoreCase(ID)) {
- id = (UniqueIdentity)obj;
- } else {
- throw new IOException("Attribute name not recognized by " +
- "CertAttrSet: CertificateIssuerUniqueIdentity.");
- }
- }
-
- /**
- * Get the attribute value.
- */
- public Object get(String name) throws IOException {
- if (name.equalsIgnoreCase(ID)) {
- return (id);
- } else {
- throw new IOException("Attribute name not recognized by " +
- "CertAttrSet: CertificateIssuerUniqueIdentity.");
- }
- }
-
- /**
- * Delete the attribute value.
- */
- public void delete(String name) throws IOException {
- if (name.equalsIgnoreCase(ID)) {
- id = null;
- } else {
- throw new IOException("Attribute name not recognized by " +
- "CertAttrSet: CertificateIssuerUniqueIdentity.");
- }
- }
-
- /**
- * Return an enumeration of names of attributes existing within this
- * attribute.
- */
- public Enumeration<String> getElements() {
- AttributeNameEnumeration elements = new AttributeNameEnumeration();
- elements.addElement(ID);
-
- return (elements.elements());
- }
-
- /**
- * Return the name of this attribute.
- */
- public String getName() {
- return (NAME);
- }
-}
diff --git a/ojluni/src/main/java/sun/security/x509/CertificatePolicyId.java b/ojluni/src/main/java/sun/security/x509/CertificatePolicyId.java
index 331acaf..5f281bf 100644
--- a/ojluni/src/main/java/sun/security/x509/CertificatePolicyId.java
+++ b/ojluni/src/main/java/sun/security/x509/CertificatePolicyId.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -93,7 +93,8 @@
*/
public boolean equals(Object other) {
if (other instanceof CertificatePolicyId)
- return id.equals(((CertificatePolicyId) other).getIdentifier());
+ return id.equals((Object)
+ ((CertificatePolicyId) other).getIdentifier());
else
return false;
}
diff --git a/ojluni/src/main/java/sun/security/x509/CertificateSerialNumber.java b/ojluni/src/main/java/sun/security/x509/CertificateSerialNumber.java
index 440f5d5..0e47fc8 100644
--- a/ojluni/src/main/java/sun/security/x509/CertificateSerialNumber.java
+++ b/ojluni/src/main/java/sun/security/x509/CertificateSerialNumber.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -141,7 +141,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public SerialNumber get(String name) throws IOException {
if (name.equalsIgnoreCase(NUMBER)) {
return (serial);
} else {
diff --git a/ojluni/src/main/java/sun/security/x509/CertificateSubjectUniqueIdentity.java b/ojluni/src/main/java/sun/security/x509/CertificateSubjectUniqueIdentity.java
deleted file mode 100644
index f9cca49..0000000
--- a/ojluni/src/main/java/sun/security/x509/CertificateSubjectUniqueIdentity.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.security.x509;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.Enumeration;
-
-import sun.security.util.*;
-
-/**
- * This class defines the subject/issuer unique identity attribute
- * for the Certificate.
- *
- * @author Amit Kapoor
- * @author Hemma Prafullchandra
- * @see CertAttrSet
- */
-public class CertificateSubjectUniqueIdentity implements CertAttrSet<String> {
- /**
- * Identifier for this attribute, to be used with the
- * get, set, delete methods of Certificate, x509 type.
- */
- public static final String IDENT = "x509.info.subjectID";
- /**
- * Sub attributes name for this CertAttrSet.
- */
- public static final String NAME = "subjectID";
- public static final String ID = "id";
-
- private UniqueIdentity id;
-
- /**
- * Default constructor for the certificate attribute.
- *
- * @param key the UniqueIdentity
- */
- public CertificateSubjectUniqueIdentity(UniqueIdentity id) {
- this.id = id;
- }
-
- /**
- * Create the object, decoding the values from the passed DER stream.
- *
- * @param in the DerInputStream to read the UniqueIdentity from.
- * @exception IOException on decoding errors.
- */
- public CertificateSubjectUniqueIdentity(DerInputStream in)
- throws IOException {
- id = new UniqueIdentity(in);
- }
-
- /**
- * Create the object, decoding the values from the passed stream.
- *
- * @param in the InputStream to read the UniqueIdentity from.
- * @exception IOException on decoding errors.
- */
- public CertificateSubjectUniqueIdentity(InputStream in)
- throws IOException {
- DerValue val = new DerValue(in);
- id = new UniqueIdentity(val);
- }
-
- /**
- * Create the object, decoding the values from the passed DER value.
- *
- * @param in the DerValue to read the UniqueIdentity from.
- * @exception IOException on decoding errors.
- */
- public CertificateSubjectUniqueIdentity(DerValue val)
- throws IOException {
- id = new UniqueIdentity(val);
- }
-
- /**
- * Return the identity as user readable string.
- */
- public String toString() {
- if (id == null) return "";
- return(id.toString());
- }
-
- /**
- * Encode the identity in DER form to the stream.
- *
- * @param out the DerOutputStream to marshal the contents to.
- * @exception IOException on errors.
- */
- public void encode(OutputStream out) throws IOException {
- DerOutputStream tmp = new DerOutputStream();
- id.encode(tmp,DerValue.createTag(DerValue.TAG_CONTEXT,false,(byte)2));
-
- out.write(tmp.toByteArray());
- }
-
- /**
- * Set the attribute value.
- */
- public void set(String name, Object obj) throws IOException {
- if (!(obj instanceof UniqueIdentity)) {
- throw new IOException("Attribute must be of type UniqueIdentity.");
- }
- if (name.equalsIgnoreCase(ID)) {
- id = (UniqueIdentity)obj;
- } else {
- throw new IOException("Attribute name not recognized by " +
- "CertAttrSet: CertificateSubjectUniqueIdentity.");
- }
- }
-
- /**
- * Get the attribute value.
- */
- public Object get(String name) throws IOException {
- if (name.equalsIgnoreCase(ID)) {
- return(id);
- } else {
- throw new IOException("Attribute name not recognized by " +
- "CertAttrSet: CertificateSubjectUniqueIdentity.");
- }
- }
-
- /**
- * Delete the attribute value.
- */
- public void delete(String name) throws IOException {
- if (name.equalsIgnoreCase(ID)) {
- id = null;
- } else {
- throw new IOException("Attribute name not recognized by " +
- "CertAttrSet: CertificateSubjectUniqueIdentity.");
- }
- }
-
- /**
- * Return an enumeration of names of attributes existing within this
- * attribute.
- */
- public Enumeration<String> getElements() {
- AttributeNameEnumeration elements = new AttributeNameEnumeration();
- elements.addElement(ID);
-
- return (elements.elements());
- }
-
- /**
- * Return the name of this attribute.
- */
- public String getName() {
- return (NAME);
- }
-}
diff --git a/ojluni/src/main/java/sun/security/x509/CertificateValidity.java b/ojluni/src/main/java/sun/security/x509/CertificateValidity.java
index 5273535..cd9b00f 100644
--- a/ojluni/src/main/java/sun/security/x509/CertificateValidity.java
+++ b/ojluni/src/main/java/sun/security/x509/CertificateValidity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -190,7 +190,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public Date get(String name) throws IOException {
if (name.equalsIgnoreCase(NOT_BEFORE)) {
return (getNotBefore());
} else if (name.equalsIgnoreCase(NOT_AFTER)) {
diff --git a/ojluni/src/main/java/sun/security/x509/CertificateVersion.java b/ojluni/src/main/java/sun/security/x509/CertificateVersion.java
index c5fcbdc..040b3be 100644
--- a/ojluni/src/main/java/sun/security/x509/CertificateVersion.java
+++ b/ojluni/src/main/java/sun/security/x509/CertificateVersion.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -191,7 +191,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public Integer get(String name) throws IOException {
if (name.equalsIgnoreCase(VERSION)) {
return(new Integer(getVersion()));
} else {
diff --git a/ojluni/src/main/java/sun/security/x509/CertificateX509Key.java b/ojluni/src/main/java/sun/security/x509/CertificateX509Key.java
index 1cabf59..d78d618 100644
--- a/ojluni/src/main/java/sun/security/x509/CertificateX509Key.java
+++ b/ojluni/src/main/java/sun/security/x509/CertificateX509Key.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -122,7 +122,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public PublicKey get(String name) throws IOException {
if (name.equalsIgnoreCase(KEY)) {
return(key);
} else {
diff --git a/ojluni/src/main/java/sun/security/x509/DNSName.java b/ojluni/src/main/java/sun/security/x509/DNSName.java
index 398e93f..2a35b86 100644
--- a/ojluni/src/main/java/sun/security/x509/DNSName.java
+++ b/ojluni/src/main/java/sun/security/x509/DNSName.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -159,7 +159,7 @@
* @return a hash code value for this object.
*/
public int hashCode() {
- return name.toUpperCase().hashCode();
+ return name.toUpperCase(Locale.ENGLISH).hashCode();
}
/**
diff --git a/ojluni/src/main/java/sun/security/x509/ExtendedKeyUsageExtension.java b/ojluni/src/main/java/sun/security/x509/ExtendedKeyUsageExtension.java
index b0bac3d..68084602 100644
--- a/ojluni/src/main/java/sun/security/x509/ExtendedKeyUsageExtension.java
+++ b/ojluni/src/main/java/sun/security/x509/ExtendedKeyUsageExtension.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -241,6 +241,7 @@
/**
* Set the attribute value.
*/
+ @SuppressWarnings("unchecked") // Checked with instanceof
public void set(String name, Object obj) throws IOException {
if (name.equalsIgnoreCase(USAGES)) {
if (!(obj instanceof Vector)) {
@@ -258,7 +259,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public Vector<ObjectIdentifier> get(String name) throws IOException {
if (name.equalsIgnoreCase(USAGES)) {
//XXXX May want to consider cloning this
return keyUsages;
diff --git a/ojluni/src/main/java/sun/security/x509/InvalidityDateExtension.java b/ojluni/src/main/java/sun/security/x509/InvalidityDateExtension.java
index 7e8e48c..eda0216 100644
--- a/ojluni/src/main/java/sun/security/x509/InvalidityDateExtension.java
+++ b/ojluni/src/main/java/sun/security/x509/InvalidityDateExtension.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -138,7 +138,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public Date get(String name) throws IOException {
if (name.equalsIgnoreCase(DATE)) {
if (date == null) {
return null;
diff --git a/ojluni/src/main/java/sun/security/x509/OIDMap.java b/ojluni/src/main/java/sun/security/x509/OIDMap.java
index 395f411..9eed0f2 100644
--- a/ojluni/src/main/java/sun/security/x509/OIDMap.java
+++ b/ojluni/src/main/java/sun/security/x509/OIDMap.java
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2014 The Android Open Source Project
- * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
import java.io.IOException;
import java.security.cert.CertificateException;
-import java.security.cert.CertificateParsingException;
import sun.security.util.*;
@@ -186,9 +185,9 @@
final ObjectIdentifier oid;
final String name;
- private final Class clazz;
+ private volatile Class<?> clazz;
- OIDInfo(String name, ObjectIdentifier oid, Class clazz) {
+ OIDInfo(String name, ObjectIdentifier oid, Class<?> clazz) {
this.name = name;
this.oid = oid;
this.clazz = clazz;
@@ -197,7 +196,7 @@
/**
* Return the Class object associated with this attribute.
*/
- Class getClazz() throws CertificateException {
+ Class<?> getClazz() throws CertificateException {
return clazz;
}
}
@@ -211,7 +210,7 @@
* @param clazz the Class object associated with this attribute
* @exception CertificateException on errors.
*/
- public static void addAttribute(String name, String oid, Class clazz)
+ public static void addAttribute(String name, String oid, Class<?> clazz)
throws CertificateException {
ObjectIdentifier objId;
try {
@@ -260,7 +259,7 @@
* @param name the user friendly name.
* @exception CertificateException if class cannot be instantiated.
*/
- public static Class getClass(String name) throws CertificateException {
+ public static Class<?> getClass(String name) throws CertificateException {
OIDInfo info = nameMap.get(name);
return (info == null) ? null : info.getClazz();
}
@@ -271,7 +270,7 @@
* @param oid the name of the object identifier to be returned.
* @exception CertificateException if class cannot be instatiated.
*/
- public static Class getClass(ObjectIdentifier oid)
+ public static Class<?> getClass(ObjectIdentifier oid)
throws CertificateException {
OIDInfo info = oidMap.get(oid);
return (info == null) ? null : info.getClazz();
diff --git a/ojluni/src/main/java/sun/security/x509/OIDName.java b/ojluni/src/main/java/sun/security/x509/OIDName.java
index 9dee515..44187b0 100644
--- a/ojluni/src/main/java/sun/security/x509/OIDName.java
+++ b/ojluni/src/main/java/sun/security/x509/OIDName.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -120,7 +120,7 @@
OIDName other = (OIDName)obj;
- return oid.equals(other.oid);
+ return oid.equals((Object)other.oid);
}
/**
diff --git a/ojluni/src/main/java/sun/security/x509/OtherName.java b/ojluni/src/main/java/sun/security/x509/OtherName.java
index bb3a205..d2b68da 100644
--- a/ojluni/src/main/java/sun/security/x509/OtherName.java
+++ b/ojluni/src/main/java/sun/security/x509/OtherName.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -120,19 +120,19 @@
private GeneralNameInterface getGNI(ObjectIdentifier oid, byte[] nameValue)
throws IOException {
try {
- Class extClass = OIDMap.getClass(oid);
+ Class<?> extClass = OIDMap.getClass(oid);
if (extClass == null) { // Unsupported OtherName
return null;
}
- Class[] params = { Object.class };
- Constructor cons = ((Class<?>)extClass).getConstructor(params);
+ Class<?>[] params = { Object.class };
+ Constructor<?> cons = extClass.getConstructor(params);
Object[] passed = new Object[] { nameValue };
GeneralNameInterface gni =
(GeneralNameInterface)cons.newInstance(passed);
return gni;
} catch (Exception e) {
- throw (IOException)new IOException("Instantiation error: " + e).initCause(e);
+ throw new IOException("Instantiation error: " + e, e);
}
}
@@ -176,7 +176,7 @@
return false;
}
OtherName otherOther = (OtherName)other;
- if (!(otherOther.oid.equals(oid))) {
+ if (!(otherOther.oid.equals((Object)oid))) {
return false;
}
GeneralNameInterface otherGNI = null;
diff --git a/ojluni/src/main/java/sun/security/x509/PolicyInformation.java b/ojluni/src/main/java/sun/security/x509/PolicyInformation.java
index a8eb9fa..0e98e42 100644
--- a/ojluni/src/main/java/sun/security/x509/PolicyInformation.java
+++ b/ojluni/src/main/java/sun/security/x509/PolicyInformation.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -186,6 +186,7 @@
/**
* Set the attribute value.
*/
+ @SuppressWarnings("unchecked") // Checked with instanceof
public void set(String name, Object obj) throws IOException {
if (name.equalsIgnoreCase(ID)) {
if (obj instanceof CertificatePolicyId)
diff --git a/ojluni/src/main/java/sun/security/x509/PrivateKeyUsageExtension.java b/ojluni/src/main/java/sun/security/x509/PrivateKeyUsageExtension.java
index 43b3ddc..c20d855 100644
--- a/ojluni/src/main/java/sun/security/x509/PrivateKeyUsageExtension.java
+++ b/ojluni/src/main/java/sun/security/x509/PrivateKeyUsageExtension.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -262,7 +262,7 @@
* Get the attribute value.
* @exception CertificateException on attribute handling errors.
*/
- public Object get(String name) throws CertificateException {
+ public Date get(String name) throws CertificateException {
if (name.equalsIgnoreCase(NOT_BEFORE)) {
return (new Date(notBefore.getTime()));
} else if (name.equalsIgnoreCase(NOT_AFTER)) {
diff --git a/ojluni/src/main/java/sun/security/x509/RFC822Name.java b/ojluni/src/main/java/sun/security/x509/RFC822Name.java
index 8f56903..e905ae1 100644
--- a/ojluni/src/main/java/sun/security/x509/RFC822Name.java
+++ b/ojluni/src/main/java/sun/security/x509/RFC822Name.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -153,7 +153,7 @@
* @return a hash code value for this object.
*/
public int hashCode() {
- return name.toUpperCase().hashCode();
+ return name.toUpperCase(Locale.ENGLISH).hashCode();
}
/**
diff --git a/ojluni/src/main/java/sun/security/x509/SubjectInfoAccessExtension.java b/ojluni/src/main/java/sun/security/x509/SubjectInfoAccessExtension.java
index 8e08b9a..2f851f7 100644
--- a/ojluni/src/main/java/sun/security/x509/SubjectInfoAccessExtension.java
+++ b/ojluni/src/main/java/sun/security/x509/SubjectInfoAccessExtension.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -167,6 +167,7 @@
/**
* Set the attribute value.
*/
+ @SuppressWarnings("unchecked") // Checked with instanceof
public void set(String name, Object obj) throws IOException {
if (name.equalsIgnoreCase(DESCRIPTIONS)) {
if (!(obj instanceof List)) {
@@ -184,7 +185,7 @@
/**
* Get the attribute value.
*/
- public Object get(String name) throws IOException {
+ public List<AccessDescription> get(String name) throws IOException {
if (name.equalsIgnoreCase(DESCRIPTIONS)) {
return accessDescriptions;
} else {
diff --git a/ojluni/src/main/java/sun/security/x509/URIName.java b/ojluni/src/main/java/sun/security/x509/URIName.java
index 9e7c54c..034117e 100644
--- a/ojluni/src/main/java/sun/security/x509/URIName.java
+++ b/ojluni/src/main/java/sun/security/x509/URIName.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -106,8 +106,7 @@
try {
uri = new URI(name);
} catch (URISyntaxException use) {
- throw (IOException) new IOException
- ("invalid URI name:" + name).initCause(use);
+ throw new IOException("invalid URI name:" + name, use);
}
if (uri.getScheme() == null) {
throw new IOException("URI name must include scheme:" + name);
@@ -160,8 +159,7 @@
try {
uri = new URI(name);
} catch (URISyntaxException use) {
- throw (IOException) new IOException
- ("invalid URI name constraint:" + name).initCause(use);
+ throw new IOException("invalid URI name constraint:" + name, use);
}
if (uri.getScheme() == null) {
String host = uri.getSchemeSpecificPart();
@@ -174,8 +172,7 @@
}
return new URIName(uri, host, hostDNS);
} catch (IOException ioe) {
- throw (IOException) new IOException
- ("invalid URI name constraint:" + name).initCause(ioe);
+ throw new IOException("invalid URI name constraint:" + name, ioe);
}
} else {
throw new IOException("invalid URI name constraint (should not " +
diff --git a/ojluni/src/main/java/sun/security/x509/X509CRLEntryImpl.java b/ojluni/src/main/java/sun/security/x509/X509CRLEntryImpl.java
index a074c38..ab72709 100644
--- a/ojluni/src/main/java/sun/security/x509/X509CRLEntryImpl.java
+++ b/ojluni/src/main/java/sun/security/x509/X509CRLEntryImpl.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
@@ -25,11 +25,9 @@
package sun.security.x509;
-import java.io.InputStream;
import java.io.IOException;
import java.security.cert.CRLException;
import java.security.cert.CRLReason;
-import java.security.cert.CertificateException;
import java.security.cert.X509CRLEntry;
import java.math.BigInteger;
import java.util.*;
@@ -281,7 +279,7 @@
if (obj == null)
return null;
CRLReasonCodeExtension reasonCode = (CRLReasonCodeExtension)obj;
- return (Integer)(reasonCode.get(reasonCode.REASON));
+ return reasonCode.get(CRLReasonCodeExtension.REASON);
}
/**
@@ -299,13 +297,13 @@
sb.append("\n Certificate issuer: " + certIssuer);
}
if (extensions != null) {
- Collection allEntryExts = extensions.getAllExtensions();
- Object[] objs = allEntryExts.toArray();
+ Collection<Extension> allEntryExts = extensions.getAllExtensions();
+ Extension[] exts = allEntryExts.toArray(new Extension[0]);
- sb.append("\n CRL Entry Extensions: " + objs.length);
- for (int i = 0; i < objs.length; i++) {
+ sb.append("\n CRL Entry Extensions: " + exts.length);
+ for (int i = 0; i < exts.length; i++) {
sb.append("\n [" + (i+1) + "]: ");
- Extension ext = (Extension)objs[i];
+ Extension ext = exts[i];
try {
if (OIDMap.getClass(ext.getExtensionId()) == null) {
sb.append(ext.toString());
@@ -409,7 +407,7 @@
e.hasMoreElements();) {
ex = e.nextElement();
inCertOID = ex.getExtensionId();
- if (inCertOID.equals(findOID)) {
+ if (inCertOID.equals((Object)findOID)) {
crlExt = ex;
break;
}
diff --git a/ojluni/src/main/java/sun/security/x509/X509CertImpl.java b/ojluni/src/main/java/sun/security/x509/X509CertImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/Adler32.c b/ojluni/src/main/native/Adler32.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/DatagramPacket.c b/ojluni/src/main/native/DatagramPacket.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/Double.c b/ojluni/src/main/native/Double.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/FileChannelImpl.c b/ojluni/src/main/native/FileChannelImpl.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/FileDescriptor_md.c b/ojluni/src/main/native/FileDescriptor_md.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/FileDispatcherImpl.c b/ojluni/src/main/native/FileDispatcherImpl.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/FileInputStream.c b/ojluni/src/main/native/FileInputStream.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/FileKey.c b/ojluni/src/main/native/FileKey.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/FileOutputStream_md.c b/ojluni/src/main/native/FileOutputStream_md.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/FileSystem_md.c b/ojluni/src/main/native/FileSystem_md.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/Float.c b/ojluni/src/main/native/Float.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/IOUtil.c b/ojluni/src/main/native/IOUtil.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/Inet4Address.c b/ojluni/src/main/native/Inet4Address.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/Inet4AddressImpl.c b/ojluni/src/main/native/Inet4AddressImpl.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/Inet6Address.c b/ojluni/src/main/native/Inet6Address.c
old mode 100755
new mode 100644
index ad2d978..6f0ac57
--- a/ojluni/src/main/native/Inet6Address.c
+++ b/ojluni/src/main/native/Inet6Address.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -36,30 +36,33 @@
*/
jclass ia6_class;
+jfieldID ia6_holder6ID;
+
jfieldID ia6_ipaddressID;
jfieldID ia6_scopeidID;
jfieldID ia6_scopeidsetID;
jfieldID ia6_scopeifnameID;
-jfieldID ia6_scopeifnamesetID;
jmethodID ia6_ctrID;
static void Inet6Address_init(JNIEnv *env) {
+ jclass ia6h_class;
jclass c = (*env)->FindClass(env, "java/net/Inet6Address");
CHECK_NULL(c);
ia6_class = (*env)->NewGlobalRef(env, c);
CHECK_NULL(ia6_class);
- ia6_ipaddressID = (*env)->GetFieldID(env, ia6_class, "ipaddress", "[B");
+ ia6h_class = (*env)->FindClass(env, "java/net/Inet6Address$Inet6AddressHolder");
+ CHECK_NULL(ia6h_class);
+ ia6_holder6ID = (*env)->GetFieldID(env, ia6_class, "holder6", "Ljava/net/Inet6Address$Inet6AddressHolder;");
+ CHECK_NULL(ia6_holder6ID);
+ ia6_ipaddressID = (*env)->GetFieldID(env, ia6h_class, "ipaddress", "[B");
CHECK_NULL(ia6_ipaddressID);
- ia6_scopeidID = (*env)->GetFieldID(env, ia6_class, "scope_id", "I");
+ ia6_scopeidID = (*env)->GetFieldID(env, ia6h_class, "scope_id", "I");
CHECK_NULL(ia6_scopeidID);
- ia6_scopeidsetID = (*env)->GetFieldID(env, ia6_class, "scope_id_set", "Z");
- CHECK_NULL(ia6_scopeidID);
- ia6_scopeifnameID = (*env)->GetFieldID(env, ia6_class, "scope_ifname", "Ljava/net/NetworkInterface;");
+ ia6_scopeidsetID = (*env)->GetFieldID(env, ia6h_class, "scope_id_set", "Z");
+ CHECK_NULL(ia6_scopeidsetID);
+ ia6_scopeifnameID = (*env)->GetFieldID(env, ia6h_class, "scope_ifname", "Ljava/net/NetworkInterface;");
CHECK_NULL(ia6_scopeifnameID);
- ia6_scopeifnamesetID = (*env)->GetFieldID(env, ia6_class, "scope_ifname_set", "Z");
- CHECK_NULL(ia6_scopeifnamesetID);
ia6_ctrID = (*env)->GetMethodID(env, ia6_class, "<init>", "()V");
- CHECK_NULL(ia6_ctrID);
}
void register_java_net_Inet6Address(JNIEnv* env) {
diff --git a/ojluni/src/main/native/Inet6AddressImpl.c b/ojluni/src/main/native/Inet6AddressImpl.c
old mode 100755
new mode 100644
index f57a8d2..85f2314
--- a/ojluni/src/main/native/Inet6AddressImpl.c
+++ b/ojluni/src/main/native/Inet6AddressImpl.c
@@ -65,8 +65,6 @@
static jclass ni_ia6cls;
static jmethodID ni_ia4ctrID;
static jmethodID ni_ia6ctrID;
-static jfieldID ni_ia6ipaddressID;
-static int initialized = 0;
/*
* Class: java_net_Inet6AddressImpl
diff --git a/ojluni/src/main/native/InetAddress.c b/ojluni/src/main/native/InetAddress.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/NativeThread.c b/ojluni/src/main/native/NativeThread.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/NetworkInterface.c b/ojluni/src/main/native/NetworkInterface.c
old mode 100755
new mode 100644
index 0daf4db..5879df4
--- a/ojluni/src/main/native/NetworkInterface.c
+++ b/ojluni/src/main/native/NetworkInterface.c
@@ -101,7 +101,6 @@
static jmethodID ni_ia4ctrID;
static jmethodID ni_ia6ctrID;
static jmethodID ni_ibctrID;
-static jfieldID ni_ia6ipaddressID;
static jfieldID ni_ibaddressID;
static jfieldID ni_ib4broadcastID;
static jfieldID ni_ib4maskID;
@@ -147,7 +146,6 @@
ni_ia4ctrID = (*env)->GetMethodID(env, ni_ia4cls, "<init>", "()V");
ni_ia6ctrID = (*env)->GetMethodID(env, ni_ia6cls, "<init>", "()V");
ni_ibctrID = (*env)->GetMethodID(env, ni_ibcls, "<init>", "()V");
- ni_ia6ipaddressID = (*env)->GetFieldID(env, ni_ia6cls, "ipaddress", "[B");
ni_ibaddressID = (*env)->GetFieldID(env, ni_ibcls, "address", "Ljava/net/InetAddress;");
ni_ib4broadcastID = (*env)->GetFieldID(env, ni_ibcls, "broadcast", "Ljava/net/Inet4Address;");
ni_ib4maskID = (*env)->GetFieldID(env, ni_ibcls, "maskLength", "S");
@@ -281,11 +279,9 @@
if (family == AF_INET6) {
jbyte *bytes = (jbyte *)&(((struct sockaddr_in6*)addrP->addr)->sin6_addr);
- jbyteArray ipaddress = (*env)->GetObjectField(env, iaObj, ni_ia6ipaddressID);
jbyte caddr[16];
int i;
-
- (*env)->GetByteArrayRegion(env, ipaddress, 0, 16, caddr);
+ getInet6Address_ipaddress(env, iaObj, (char *)caddr);
i = 0;
while (i < 16) {
if (caddr[i] != bytes[i]) {
@@ -478,21 +474,15 @@
int scope=0;
iaObj = (*env)->NewObject(env, ni_ia6cls, ni_ia6ctrID);
if (iaObj) {
- jbyteArray ipaddress = (*env)->NewByteArray(env, 16);
- if (ipaddress == NULL) {
+ int ret = setInet6Address_ipaddress(env, iaObj, (char *)&(((struct sockaddr_in6*)addrP->addr)->sin6_addr));
+ if (ret == JNI_FALSE) {
return NULL;
}
- (*env)->SetByteArrayRegion(env, ipaddress, 0, 16,
- (jbyte *)&(((struct sockaddr_in6*)addrP->addr)->sin6_addr));
-
scope = ((struct sockaddr_in6*)addrP->addr)->sin6_scope_id;
-
if (scope != 0) { /* zero is default value, no need to set */
- (*env)->SetIntField(env, iaObj, ia6_scopeidID, scope);
- (*env)->SetBooleanField(env, iaObj, ia6_scopeidsetID, JNI_TRUE);
- (*env)->SetObjectField(env, iaObj, ia6_scopeifnameID, netifObj);
+ setInet6Address_scopeid(env, iaObj, scope);
+ setInet6Address_scopeifname(env, iaObj, netifObj);
}
- (*env)->SetObjectField(env, iaObj, ni_ia6ipaddressID, ipaddress);
}
ibObj = (*env)->NewObject(env, ni_ibcls, ni_ibctrID);
if (ibObj) {
diff --git a/ojluni/src/main/native/ObjectStreamClass.c b/ojluni/src/main/native/ObjectStreamClass.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/PlainDatagramSocketImpl.c b/ojluni/src/main/native/PlainDatagramSocketImpl.c
old mode 100755
new mode 100644
index c04acc6..d7edb5f
--- a/ojluni/src/main/native/PlainDatagramSocketImpl.c
+++ b/ojluni/src/main/native/PlainDatagramSocketImpl.c
@@ -1847,8 +1847,8 @@
caddr[14] = ((address >> 8) & 0xff);
caddr[15] = (address & 0xff);
} else {
- ipaddress = (*env)->GetObjectField(env, iaObj, ia6_ipaddressID);
- (*env)->GetByteArrayRegion(env, ipaddress, 0, 16, caddr);
+ // Android-changed: explicit cast to suppress compiler warning.
+ getInet6Address_ipaddress(env, iaObj, (char*)caddr);
}
memcpy((void *)&(mname6.ipv6mr_multiaddr), caddr, sizeof(struct in6_addr));
diff --git a/ojluni/src/main/native/PlainSocketImpl.c b/ojluni/src/main/native/PlainSocketImpl.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/ProcessEnvironment_md.c b/ojluni/src/main/native/ProcessEnvironment_md.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/Runtime.c b/ojluni/src/main/native/Runtime.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/SocketInputStream.c b/ojluni/src/main/native/SocketInputStream.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/SocketOutputStream.c b/ojluni/src/main/native/SocketOutputStream.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/StrictMath.c b/ojluni/src/main/native/StrictMath.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/String.c b/ojluni/src/main/native/String.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/System.c b/ojluni/src/main/native/System.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/Thread.c b/ojluni/src/main/native/Thread.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/Throwable.c b/ojluni/src/main/native/Throwable.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/UNIXProcess_md.c b/ojluni/src/main/native/UNIXProcess_md.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/UnixFileSystem_md.c b/ojluni/src/main/native/UnixFileSystem_md.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/canonicalize_md.c b/ojluni/src/main/native/canonicalize_md.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/classfile_constants.h b/ojluni/src/main/native/classfile_constants.h
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/fdlibm.h b/ojluni/src/main/native/fdlibm.h
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/io_util.h b/ojluni/src/main/native/io_util.h
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/io_util_md.c b/ojluni/src/main/native/io_util_md.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/io_util_md.h b/ojluni/src/main/native/io_util_md.h
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/java_net_Inet4AddressImpl.h b/ojluni/src/main/native/java_net_Inet4AddressImpl.h
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/java_props_md.c b/ojluni/src/main/native/java_props_md.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/jfdlibm.h b/ojluni/src/main/native/jfdlibm.h
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/jlong.h b/ojluni/src/main/native/jlong.h
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/jlong_md.h b/ojluni/src/main/native/jlong_md.h
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/jni_util.h b/ojluni/src/main/native/jni_util.h
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/jni_util_md.c b/ojluni/src/main/native/jni_util_md.c
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/jvm_md.h b/ojluni/src/main/native/jvm_md.h
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/linux_close.cpp b/ojluni/src/main/native/linux_close.cpp
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/net_util.c b/ojluni/src/main/native/net_util.c
old mode 100755
new mode 100644
index a656ed3..af6a893
--- a/ojluni/src/main/native/net_util.c
+++ b/ojluni/src/main/native/net_util.c
@@ -72,26 +72,116 @@
extern jfieldID iac_addressID;
extern jfieldID iac_familyID;
+/**
+ * set_ methods return JNI_TRUE on success JNI_FALSE on error
+ * get_ methods that return +ve int return -1 on error
+ * get_ methods that return objects return NULL on error.
+ */
+jobject getInet6Address_scopeifname(JNIEnv *env, jobject iaObj) {
+ jobject holder;
+
+ // Android-changed: initInetAddrs(env);
+ holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID);
+ CHECK_NULL_RETURN(holder, NULL);
+ return (*env)->GetObjectField(env, holder, ia6_scopeifnameID);
+}
+
+int setInet6Address_scopeifname(JNIEnv *env, jobject iaObj, jobject scopeifname) {
+ jobject holder;
+
+ // Android-changed: initInetAddrs(env);
+ holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID);
+ CHECK_NULL_RETURN(holder, JNI_FALSE);
+ (*env)->SetObjectField(env, holder, ia6_scopeifnameID, scopeifname);
+ return JNI_TRUE;
+}
+
+int getInet6Address_scopeid_set(JNIEnv *env, jobject iaObj) {
+ jobject holder;
+
+ // Android-changed: initInetAddrs(env);
+ holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID);
+ CHECK_NULL_RETURN(holder, -1);
+ return (*env)->GetBooleanField(env, holder, ia6_scopeidsetID);
+}
+
+int getInet6Address_scopeid(JNIEnv *env, jobject iaObj) {
+ jobject holder;
+
+ // Android-changed: initInetAddrs(env);
+ holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID);
+ CHECK_NULL_RETURN(holder, -1);
+ return (*env)->GetIntField(env, holder, ia6_scopeidID);
+}
+
+int setInet6Address_scopeid(JNIEnv *env, jobject iaObj, int scopeid) {
+ jobject holder;
+
+ // Android-changed: initInetAddrs(env);
+ holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID);
+ CHECK_NULL_RETURN(holder, JNI_FALSE);
+ (*env)->SetIntField(env, holder, ia6_scopeidID, scopeid);
+ if (scopeid > 0) {
+ (*env)->SetBooleanField(env, holder, ia6_scopeidsetID, JNI_TRUE);
+ }
+ return JNI_TRUE;
+}
+
+
+int getInet6Address_ipaddress(JNIEnv *env, jobject iaObj, char *dest) {
+ jobject holder, addr;
+ jbyteArray barr;
+
+ // Android-changed: initInetAddrs(env);
+ holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID);
+ CHECK_NULL_RETURN(holder, JNI_FALSE);
+ addr = (*env)->GetObjectField(env, holder, ia6_ipaddressID);
+ CHECK_NULL_RETURN(addr, JNI_FALSE);
+ (*env)->GetByteArrayRegion(env, addr, 0, 16, (jbyte *)dest);
+ return JNI_TRUE;
+}
+
+int setInet6Address_ipaddress(JNIEnv *env, jobject iaObj, char *address) {
+ jobject holder;
+ jbyteArray addr;
+
+ // Android-changed: initInetAddrs(env);
+ holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID);
+ CHECK_NULL_RETURN(holder, JNI_FALSE);
+ addr = (jbyteArray)(*env)->GetObjectField(env, holder, ia6_ipaddressID);
+ if (addr == NULL) {
+ addr = (*env)->NewByteArray(env, 16);
+ CHECK_NULL_RETURN(addr, JNI_FALSE);
+ (*env)->SetObjectField(env, holder, ia6_ipaddressID, addr);
+ }
+ (*env)->SetByteArrayRegion(env, addr, 0, 16, (jbyte *)address);
+ return JNI_TRUE;
+}
+
void setInetAddress_addr(JNIEnv *env, jobject iaObj, int address) {
jobject holder;
+ // Android-changed: initInetAddrs(env);
holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
(*env)->SetIntField(env, holder, iac_addressID, address);
}
void setInetAddress_family(JNIEnv *env, jobject iaObj, int family) {
jobject holder;
+ // Android-changed: initInetAddrs(env);
holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
(*env)->SetIntField(env, holder, iac_familyID, family);
}
void setInetAddress_hostName(JNIEnv *env, jobject iaObj, jobject host) {
jobject holder;
+ // Android-changed: initInetAddrs(env);
holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
(*env)->SetObjectField(env, holder, iac_hostNameID, host);
}
int getInetAddress_addr(JNIEnv *env, jobject iaObj) {
jobject holder;
+ // Android-changed: initInetAddrs(env);
holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
return (*env)->GetIntField(env, holder, iac_addressID);
}
@@ -99,12 +189,14 @@
int getInetAddress_family(JNIEnv *env, jobject iaObj) {
jobject holder;
+ // Android-changed: initInetAddrs(env);
holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
return (*env)->GetIntField(env, holder, iac_familyID);
}
jobject getInetAddress_hostName(JNIEnv *env, jobject iaObj) {
jobject holder;
+ // Android-changed: initInetAddrs(env);
holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
return (*env)->GetObjectField(env, holder, iac_hostNameID);
}
@@ -112,6 +204,7 @@
JNIEXPORT jobject JNICALL
NET_SockaddrToInetAddress(JNIEnv *env, struct sockaddr *him, int *port) {
jobject iaObj;
+ // Android-changed: initInetAddrs(env);
#ifdef AF_INET6
if (him->sa_family == AF_INET6) {
jbyteArray ipaddress;
@@ -139,6 +232,7 @@
} else {
static jclass inet6Cls = 0;
jint scope;
+ int ret;
if (inet6Cls == 0) {
jclass c = (*env)->FindClass(env, "java/net/Inet6Address");
CHECK_NULL_RETURN(c, NULL);
@@ -148,18 +242,13 @@
}
iaObj = (*env)->NewObject(env, inet6Cls, ia6_ctrID);
CHECK_NULL_RETURN(iaObj, NULL);
- ipaddress = (*env)->NewByteArray(env, 16);
- CHECK_NULL_RETURN(ipaddress, NULL);
- (*env)->SetByteArrayRegion(env, ipaddress, 0, 16,
- (jbyte *)&(him6->sin6_addr));
-
- (*env)->SetObjectField(env, iaObj, ia6_ipaddressID, ipaddress);
-
+ ret = setInet6Address_ipaddress(env, iaObj, (char *)&(him6->sin6_addr));
+ // Android-changed: Appease compiler type checking.
+ // CHECK_NULL_RETURN(ret, NULL);
+ if (ret == JNI_FALSE) return NULL;
setInetAddress_family(env, iaObj, IPv6);
scope = getScopeID(him);
- (*env)->SetIntField(env, iaObj, ia6_scopeidID, scope);
- if (scope > 0)
- (*env)->SetBooleanField(env, iaObj, ia6_scopeidsetID, JNI_TRUE);
+ setInet6Address_scopeid(env, iaObj, scope);
}
*port = ntohs(him6->sin6_port);
} else
@@ -225,9 +314,8 @@
if (family == AF_INET) {
return JNI_FALSE;
}
- ipaddress = (*env)->GetObjectField(env, iaObj, ia6_ipaddressID);
- scope = (*env)->GetIntField(env, iaObj, ia6_scopeidID);
- (*env)->GetByteArrayRegion(env, ipaddress, 0, 16, caddrCur);
+ scope = getInet6Address_scopeid(env, iaObj);
+ getInet6Address_ipaddress(env, iaObj, (char *)caddrCur);
if (NET_IsEqual(caddrNew, caddrCur) && cmpScopeID(scope, him)) {
return JNI_TRUE;
} else {
diff --git a/ojluni/src/main/native/net_util.h b/ojluni/src/main/native/net_util.h
old mode 100755
new mode 100644
index 2f5cffd..8888877
--- a/ojluni/src/main/native/net_util.h
+++ b/ojluni/src/main/native/net_util.h
@@ -58,6 +58,19 @@
extern jfieldID iac_hostNameID;
extern jfieldID ia_preferIPv6AddressID;
+/** (Inet6Address accessors)
+ * set_ methods return JNI_TRUE on success JNI_FALSE on error
+ * get_ methods that return int/boolean, return -1 on error
+ * get_ methods that return objects return NULL on error.
+ */
+extern jobject getInet6Address_scopeifname(JNIEnv *env, jobject ia6Obj);
+extern int setInet6Address_scopeifname(JNIEnv *env, jobject ia6Obj, jobject scopeifname);
+extern int getInet6Address_scopeid_set(JNIEnv *env, jobject ia6Obj);
+extern int getInet6Address_scopeid(JNIEnv *env, jobject ia6Obj);
+extern int setInet6Address_scopeid(JNIEnv *env, jobject ia6Obj, int scopeid);
+extern int getInet6Address_ipaddress(JNIEnv *env, jobject ia6Obj, char *dest);
+extern int setInet6Address_ipaddress(JNIEnv *env, jobject ia6Obj, char *address);
+
extern void setInetAddress_addr(JNIEnv *env, jobject iaObj, int address);
extern void setInetAddress_family(JNIEnv *env, jobject iaObj, int family);
extern void setInetAddress_hostName(JNIEnv *env, jobject iaObj, jobject h);
@@ -93,11 +106,11 @@
/* Inet6Address fields */
extern jclass ia6_class;
+extern jfieldID ia6_holder6ID;
extern jfieldID ia6_ipaddressID;
extern jfieldID ia6_scopeidID;
extern jfieldID ia6_scopeidsetID;
extern jfieldID ia6_scopeifnameID;
-extern jfieldID ia6_scopeifnamesetID;
extern jmethodID ia6_ctrID;
/************************************************************************
diff --git a/ojluni/src/main/native/net_util_md.c b/ojluni/src/main/native/net_util_md.c
old mode 100755
new mode 100644
index d45a0e6..f1d60fe
--- a/ojluni/src/main/native/net_util_md.c
+++ b/ojluni/src/main/native/net_util_md.c
@@ -772,8 +772,7 @@
caddr[15] = (address & 0xff);
}
} else {
- ipaddress = (*env)->GetObjectField(env, iaObj, ia6_ipaddressID);
- (*env)->GetByteArrayRegion(env, ipaddress, 0, 16, caddr);
+ getInet6Address_ipaddress(env, iaObj, (char *)caddr);
}
memset((char *)him6, 0, sizeof(struct sockaddr_in6));
him6->sin6_port = htons(port);
@@ -791,7 +790,7 @@
// was constructed with a specific scope_id or NetworkInterface).
if (family != IPv4) {
if (ia6_scopeidID) {
- int scope_id = (int)(*env)->GetIntField(env, iaObj, ia6_scopeidID);
+ int scope_id = getInet6Address_scopeid(env, iaObj);
if (scope_id > 0) {
him6->sin6_scope_id = scope_id;
}
diff --git a/ojluni/src/main/native/net_util_md.h b/ojluni/src/main/native/net_util_md.h
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/nio.h b/ojluni/src/main/native/nio.h
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/nio_util.h b/ojluni/src/main/native/nio_util.h
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/native/zip_util.h b/ojluni/src/main/native/zip_util.h
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/resources/sun/nio/cs/standard-charsets b/ojluni/src/main/resources/sun/nio/cs/standard-charsets
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/resources/sun/util/logging/resources/logging.properties b/ojluni/src/main/resources/sun/util/logging/resources/logging.properties
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/resources/sun/util/logging/resources/logging_de.properties b/ojluni/src/main/resources/sun/util/logging/resources/logging_de.properties
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/resources/sun/util/logging/resources/logging_es.properties b/ojluni/src/main/resources/sun/util/logging/resources/logging_es.properties
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/resources/sun/util/logging/resources/logging_fr.properties b/ojluni/src/main/resources/sun/util/logging/resources/logging_fr.properties
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/resources/sun/util/logging/resources/logging_it.properties b/ojluni/src/main/resources/sun/util/logging/resources/logging_it.properties
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/resources/sun/util/logging/resources/logging_ja.properties b/ojluni/src/main/resources/sun/util/logging/resources/logging_ja.properties
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/resources/sun/util/logging/resources/logging_ko.properties b/ojluni/src/main/resources/sun/util/logging/resources/logging_ko.properties
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/resources/sun/util/logging/resources/logging_pt_BR.properties b/ojluni/src/main/resources/sun/util/logging/resources/logging_pt_BR.properties
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/resources/sun/util/logging/resources/logging_sv.properties b/ojluni/src/main/resources/sun/util/logging/resources/logging_sv.properties
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/resources/sun/util/logging/resources/logging_zh_CN.properties b/ojluni/src/main/resources/sun/util/logging/resources/logging_zh_CN.properties
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/resources/sun/util/logging/resources/logging_zh_TW.properties b/ojluni/src/main/resources/sun/util/logging/resources/logging_zh_TW.properties
old mode 100755
new mode 100644
diff --git a/openjdk_java_files.mk b/openjdk_java_files.mk
index 5e4d872..10d362b 100644
--- a/openjdk_java_files.mk
+++ b/openjdk_java_files.mk
@@ -493,6 +493,7 @@
ojluni/src/main/java/java/nio/file/spi/FileSystemProvider.java \
ojluni/src/main/java/java/nio/file/spi/FileTypeDetector.java \
ojluni/src/main/java/java/nio/package-info.java \
+ ojluni/src/main/java/java/security/package-info.java \
ojluni/src/main/java/java/security/AccessControlContext.java \
ojluni/src/main/java/java/security/AccessControlException.java \
ojluni/src/main/java/java/security/AccessController.java \
@@ -504,6 +505,7 @@
ojluni/src/main/java/java/security/acl/NotOwnerException.java \
ojluni/src/main/java/java/security/acl/Owner.java \
ojluni/src/main/java/java/security/acl/Permission.java \
+ ojluni/src/main/java/java/security/acl/package-info.java \
ojluni/src/main/java/java/security/AlgorithmConstraints.java \
ojluni/src/main/java/java/security/AlgorithmParameterGenerator.java \
ojluni/src/main/java/java/security/AlgorithmParameterGeneratorSpi.java \
@@ -562,6 +564,7 @@
ojluni/src/main/java/java/security/cert/X509CRL.java \
ojluni/src/main/java/java/security/cert/X509CRLSelector.java \
ojluni/src/main/java/java/security/cert/X509Extension.java \
+ ojluni/src/main/java/java/security/cert/package-info.java \
ojluni/src/main/java/java/security/CodeSigner.java \
ojluni/src/main/java/java/security/CodeSource.java \
ojluni/src/main/java/java/security/CryptoPrimitive.java \
@@ -587,6 +590,7 @@
ojluni/src/main/java/java/security/interfaces/RSAPrivateCrtKey.java \
ojluni/src/main/java/java/security/interfaces/RSAPrivateKey.java \
ojluni/src/main/java/java/security/interfaces/RSAPublicKey.java \
+ ojluni/src/main/java/java/security/interfaces/package-info.java \
ojluni/src/main/java/java/security/InvalidAlgorithmParameterException.java \
ojluni/src/main/java/java/security/InvalidKeyException.java \
ojluni/src/main/java/java/security/InvalidParameterException.java \
@@ -1152,6 +1156,7 @@
ojluni/src/main/java/sun/misc/FDBigInteger.java \
ojluni/src/main/java/sun/misc/FloatingDecimal.java \
ojluni/src/main/java/java/lang/invoke/LambdaConversionException.java \
+ ojluni/src/main/java/java/lang/invoke/MethodHandle.java \
ojluni/src/main/java/java/lang/invoke/MethodHandleStatics.java \
ojluni/src/main/java/java/lang/invoke/MethodType.java \
ojluni/src/main/java/java/lang/invoke/MethodTypeForm.java \
@@ -1511,14 +1516,12 @@
ojluni/src/main/java/sun/security/x509/CertificateExtensions.java \
ojluni/src/main/java/sun/security/x509/CertificateIssuerExtension.java \
ojluni/src/main/java/sun/security/x509/CertificateIssuerName.java \
- ojluni/src/main/java/sun/security/x509/CertificateIssuerUniqueIdentity.java \
ojluni/src/main/java/sun/security/x509/CertificatePoliciesExtension.java \
ojluni/src/main/java/sun/security/x509/CertificatePolicyId.java \
ojluni/src/main/java/sun/security/x509/CertificatePolicyMap.java \
ojluni/src/main/java/sun/security/x509/CertificatePolicySet.java \
ojluni/src/main/java/sun/security/x509/CertificateSerialNumber.java \
ojluni/src/main/java/sun/security/x509/CertificateSubjectName.java \
- ojluni/src/main/java/sun/security/x509/CertificateSubjectUniqueIdentity.java \
ojluni/src/main/java/sun/security/x509/CertificateValidity.java \
ojluni/src/main/java/sun/security/x509/CertificateVersion.java \
ojluni/src/main/java/sun/security/x509/CertificateX509Key.java \
@@ -1604,15 +1607,21 @@
ojluni/src/main/java/sun/util/resources/OpenListResourceBundle.java \
$(openjdk_javadoc_files)
-# javac requires sections of java.lang.invoke.* to be available in the boot
-# classpath in order to compile a lambda expression in Java source. Some of
-# the classes it needs are present in core-oj, and those that aren't are
-# stubbed here. In the long term, core-oj will contain a complete
-# java.lang.invoke implementation and this list can be removed.
+# Stubs needed to satisfy javac's dependencies when compiling lambda code. These are
+# not used on Android devices or required by the Jack compiler.
+#
+# The stub files in openjdk_lambda_duplicate_stub_files are present in core-oj as
+# well, and need to be included here to support compiling against older SDKs and the
+# like. This additional bit of ugliness if required to avoid a circular dependency
+# between core-all and these stubs. Eventually, all of these stubs will become
+# "duplicates" and then that list can be renamed to "openjdk_lambda_stub_files".
openjdk_lambda_stub_files := \
ojluni/src/lambda/java/java/lang/invoke/CallSite.java \
ojluni/src/lambda/java/java/lang/invoke/LambdaMetafactory.java \
- ojluni/src/lambda/java/java/lang/invoke/MethodHandle.java \
ojluni/src/lambda/java/java/lang/invoke/MethodHandleInfo.java \
ojluni/src/lambda/java/java/lang/invoke/MethodHandles.java \
- ojluni/src/lambda/java/java/lang/invoke/SerializedLambda.java \
+ ojluni/src/lambda/java/java/lang/invoke/SerializedLambda.java
+openjdk_lambda_duplicate_stub_files := \
+ ojluni/src/lambda/java/java/lang/invoke/LambdaConversionException.java \
+ ojluni/src/lambda/java/java/lang/invoke/MethodHandle.java \
+ ojluni/src/lambda/java/java/lang/invoke/MethodType.java \