diff --git a/.hgtags b/.hgtags
index 6e2a50acf2f3b84f81797d10ddfe563e8f2a58ee..45fbf746c13291e93db1c38aa9a7615fba78fc4e 100644
--- a/.hgtags
+++ b/.hgtags
@@ -216,3 +216,7 @@ c63eda8f63008a4398d2c22ac8d72f7fef6f9238 jdk8-b90
a2a2a91075ad85becbe10a39d7fd04ef9bea8df5 jdk8-b92
691d6c6cd332d98b0f0221445a73906776f31f72 jdk8-b93
51479fa56b7c4363c6d87c2e8b898d8185cf4b22 jdk8-b94
+42aa9f1828852bb8b77e98ec695211493ae0759d jdk8-b95
+4a5d3cf2b3af1660db0237e8da324c140e534fa4 jdk8-b96
+978a95239044f26dcc8a6d59246be07ad6ca6be2 jdk8-b97
+c4908732fef5235f1b98cafe0ce507771ef7892c jdk8-b98
diff --git a/make/common/Release.gmk b/make/common/Release.gmk
index ce2dda53d1d9c86e3b6e8ec51e939898a66f02da..b584781eb50355746ef7476b6a714f469d2ff8ac 100644
--- a/make/common/Release.gmk
+++ b/make/common/Release.gmk
@@ -252,7 +252,7 @@ images:: sanity-images post-sanity-images \
$(INITIAL_IMAGE_JRE) $(INITIAL_IMAGE_JDK) \
trim-image-jre trim-image-jdk \
identify-image-jre identify-image-jdk \
- process-image-jre process-image-jdk sec-files sec-files-win jgss-files
+ process-image-jre process-image-jdk sec-files sec-files-win jgss-files
endif
# Don't use these
@@ -400,7 +400,8 @@ TOOLS = \
# classes that go into jfr.jar
JFR_CLASSES_DIRS= \
com/oracle/jrockit/jfr \
- oracle/jrockit/jfr
+ oracle/jrockit/jfr \
+ jdk/jfr
# classes that go into jsse.jar
JSSE_CLASSES_DIRS = \
@@ -612,6 +613,7 @@ ifndef JAVASE_EMBEDDED
$(ECHO) "oracle/jrockit/jfr/parser/" >> $@
$(ECHO) "oracle/jrockit/jfr/settings/" >> $@
$(ECHO) "oracle/jrockit/jfr/tools/" >> $@
+ $(ECHO) "jdk/jfr/" >> $@
endif
endif
diff --git a/make/sun/font/Makefile b/make/sun/font/Makefile
index 1cdd11934ccd1bd21a193d07f13d3bdb1d3d6f68..fd8c8a2c44840f5eb270dd823d927b0156f32765 100644
--- a/make/sun/font/Makefile
+++ b/make/sun/font/Makefile
@@ -36,7 +36,11 @@ PRODUCT = sun
CPLUSPLUSLIBRARY=true
# Use higher optimization level
+ifeq ($(PLATFORM), windows)
+OPTIMIZATION_LEVEL = HIGHEST
+else
OPTIMIZATION_LEVEL = HIGHER
+endif
include $(BUILDDIR)/common/Defs.gmk
diff --git a/makefiles/CompileNativeLibraries.gmk b/makefiles/CompileNativeLibraries.gmk
index 2fc34d8eea754e5f7bf032af069d78a20fa127c9..02bf3be808c5cc68d788be3c8051536c5f10f388 100644
--- a/makefiles/CompileNativeLibraries.gmk
+++ b/makefiles/CompileNativeLibraries.gmk
@@ -1332,7 +1332,7 @@ LIBFONTMANAGER_OPTIMIZATION:=HIGH
ifeq ($(OPENJDK_TARGET_OS),windows)
LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
X11TextRenderer.c
- LIBFONTMANAGER_OPTIMIZATION:=LOW
+LIBFONTMANAGER_OPTIMIZATION:=HIGHEST
else
LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \
lcdglyph.c
@@ -2916,7 +2916,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDALSA,\
PLATFORM_API_LinuxOS_ALSA_Ports.c,\
LANG:=C,\
OPTIMIZATION:=LOW, \
- CFLAGS:=$(CFLAGS_JDKLIB) \
+ CFLAGS:=$(CFLAGS_JDKLIB) $(ALSA_CFLAGS) \
$(LIBJSOUND_CFLAGS) \
-DUSE_DAUDIO=TRUE \
-DUSE_PORTS=TRUE \
@@ -2925,7 +2925,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDALSA,\
MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjsoundalsa/mapfile-vers, \
LDFLAGS:=$(LDFLAGS_JDKLIB)\
$(call SET_SHARED_LIBRARY_ORIGIN),\
- LDFLAGS_SUFFIX:=-lasound -ljava -ljvm,\
+ LDFLAGS_SUFFIX:=$(ALSA_LIBS) -ljava -ljvm,\
OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjsoundalsa,\
DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
diff --git a/makefiles/CopyFiles.gmk b/makefiles/CopyFiles.gmk
index 82d3d4bb40e2417f5020943668e4c27ac98084f4..cb479bba1c52ec19a8e617e244918d1fa1ba721c 100644
--- a/makefiles/CopyFiles.gmk
+++ b/makefiles/CopyFiles.gmk
@@ -538,21 +538,4 @@ COPY_FILES += $(JDK_OUTPUTDIR)/lib/sound.properties
##########################################################################################
-ifndef OPENJDK
-ifeq ($(ENABLE_JFR), true)
-
-JFR_CONFIGURATION_DIR_SRC := $(JDK_TOPDIR)/src/closed/share/classes/oracle/jrockit/jfr/settings/
-JFR_CONFIGURATION_DIR_DST := $(LIBDIR)/jfr/
-
-JFR_SRC_FILES = $(wildcard $(JFR_CONFIGURATION_DIR_SRC)/*.jfc)
-JFR_TARGET_FILES = $(subst $(JFR_CONFIGURATION_DIR_SRC),$(JFR_CONFIGURATION_DIR_DST),$(JFR_SRC_FILES))
-
-$(JFR_CONFIGURATION_DIR_DST)/%.jfc : $(JFR_CONFIGURATION_DIR_SRC)/%.jfc
- $(call install-file)
-
-COPY_FILES += $(JFR_TARGET_FILES)
-
-endif
-endif
-
-##########################################################################################
+-include $(CUSTOM_MAKE_DIR)/CopyFiles.gmk
diff --git a/makefiles/CreateJars.gmk b/makefiles/CreateJars.gmk
index 64c96b2c97e00bfe6c86a89cb23b90d8069a295e..54531f19ef5a7f86c1338df08700a82eb872e589 100644
--- a/makefiles/CreateJars.gmk
+++ b/makefiles/CreateJars.gmk
@@ -132,7 +132,7 @@ $(eval $(call SetupArchive,BUILD_LOCALEDATA_JAR,,\
##########################################################################################
# Full JRE exclude list for rt.jar and resources.jar
-# This value should exclude types destined for jars other than rt.jar and resources.jar.
+# This value should exclude types destined for jars other than rt.jar and resources.jar.
# When building a Profile this value augments the profile specific exclusions
RT_JAR_EXCLUDES += \
com/oracle/security \
@@ -246,7 +246,8 @@ RT_JAR_EXCLUDES += \
sun/util/resources/cldr \
$(LOCALEDATA_INCLUDES) \
com/oracle/jrockit/jfr \
- oracle/jrockit/jfr
+ oracle/jrockit/jfr \
+ jdk/jfr
ifeq ($(OPENJDK_TARGET_OS), macosx)
RT_JAR_EXCLUDES += com/sun/nio/sctp \
@@ -337,7 +338,7 @@ $(PROFILE_VERSION_CLASS_TARGETS) : $(PROFILE_VERSION_JAVA_TARGETS)
# Support for removing the addPropertyChangeListener and removePropertyChangeListener
-# methods from classes that only go into the profile builds.
+# methods from classes that only go into the profile builds.
BEANLESS_CLASSES = $(IMAGES_OUTPUTDIR)/beanless
# When there are $ characters in filenames we have some very subtle interactions between
@@ -352,7 +353,7 @@ CLASSES_TO_DEBEAN = \
java/util/jar/Pack200\$$Packer.class \
java/util/jar/Pack200\$$Unpacker.class \
com/sun/java/util/jar/pack/PackerImpl.class \
- com/sun/java/util/jar/pack/UnpackerImpl.class
+ com/sun/java/util/jar/pack/UnpackerImpl.class
ifneq ($(PROFILE),)
BEANLESS_CLASSES_TARGETS := $(addprefix $(BEANLESS_CLASSES)/, $(CLASSES_TO_DEBEAN))
@@ -428,7 +429,8 @@ ifeq ($(ENABLE_JFR), true)
SRCS:=$(JDK_OUTPUTDIR)/classes,\
SUFFIXES:=.class .jfc .xsd,\
INCLUDES:=com/oracle/jrockit/jfr \
- oracle/jrockit/jfr,\
+ oracle/jrockit/jfr \
+ jdk/jfr,\
JAR:=$(IMAGES_OUTPUTDIR)/lib/jfr.jar,\
SKIP_METAINF:=true,\
MANIFEST:=$(MAINMANIFEST), \
@@ -468,14 +470,14 @@ $(JCE_MANIFEST): $(MAINMANIFEST)
$(MV) $@.tmp $@
##########################################################################################
-# For security and crypto jars, always build the jar, but for closed, install the prebuilt
-# signed version instead of the newly built jar. Unsigned jars are treated as intermediate
-# targets and explicitly added to the JARS list. For open, signing is not needed. See
+# For security and crypto jars, always build the jar, but for closed, install the prebuilt
+# signed version instead of the newly built jar. Unsigned jars are treated as intermediate
+# targets and explicitly added to the JARS list. For open, signing is not needed. See
# SignJars.gmk for more information.
#
# The source for the crypto jars is not available for all licensees. The BUILD_CRYPTO
# variable is set to no if these jars can't be built to skip that step of the build.
-# Note that for OPENJDK, the build will fail if BUILD_CRYPTO=no since then there is no
+# Note that for OPENJDK, the build will fail if BUILD_CRYPTO=no since then there is no
# other way to get the jars than to build them.
SUNPKCS11_JAR_DST := $(IMAGES_OUTPUTDIR)/lib/ext/sunpkcs11.jar
@@ -738,7 +740,7 @@ $(UCRYPTO_JAR_DST) : $(UCRYPTO_JAR_SRC)
@$(ECHO) $(LOG_INFO) "\n>>>Installing prebuilt OracleUcrypto provider..."
$(install-file)
-JARS += $(UCRYPTO_JAR_UNSIGNED)
+JARS += $(UCRYPTO_JAR_UNSIGNED)
endif
endif
diff --git a/makefiles/profile-includes.txt b/makefiles/profile-includes.txt
index 8a137b8b4622918b772470457ecefdee064347a1..f4876284b735d29b585269b209bd8e96bc5fe997 100644
--- a/makefiles/profile-includes.txt
+++ b/makefiles/profile-includes.txt
@@ -125,13 +125,11 @@ PROFILE_3_JRE_LIB_FILES := \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jaas_unix$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)java_crw_demo$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)java_crw_demo.diz \
- $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jfr$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsdt$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsdt.diz \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)management$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)management.diz \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)sctp$(SHARED_LIBRARY_SUFFIX) \
- jfr.jar \
jvm.hprof.txt \
management-agent.jar \
management/jmxremote.access \
@@ -164,6 +162,7 @@ FULL_JRE_LIB_FILES := \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)fontmanager$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jawt$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jdwp$(SHARED_LIBRARY_SUFFIX) \
+ $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jfr$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jpeg$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsound$(SHARED_LIBRARY_SUFFIX) \
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsoundalsa$(SHARED_LIBRARY_SUFFIX) \
@@ -214,6 +213,7 @@ FULL_JRE_LIB_FILES := \
images/cursors/motif_MoveDrop32x32.gif \
images/cursors/motif_MoveNoDrop32x32.gif \
jexec \
+ jfr.jar \
oblique-fonts/LucidaSansDemiOblique.ttf \
oblique-fonts/LucidaSansOblique.ttf \
oblique-fonts/LucidaTypewriterBoldOblique.ttf \
diff --git a/makefiles/sun/awt/ToBin.java b/makefiles/sun/awt/ToBin.java
index 18ac89b6ec81794b324ebdb935238bccb9040285..db97240e43289a42133748c32c88938c9c1361d7 100644
--- a/makefiles/sun/awt/ToBin.java
+++ b/makefiles/sun/awt/ToBin.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013 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
diff --git a/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java b/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java
index a73dbd17802671a23ddfa8af288820e1a064a621..ae7d363b84eb0f3d455cba8f6a07d0fa5da2c531 100644
--- a/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java
+++ b/src/macosx/classes/sun/lwawt/macosx/CEmbeddedFrame.java
@@ -127,8 +127,21 @@ public class CEmbeddedFrame extends EmbeddedFrame {
}
}
+ /**
+ * When the parent window is activated this method is called for all EmbeddedFrames in it.
+ *
+ * For the CEmbeddedFrame which had focus before the deactivation this method triggers
+ * focus events in the following order:
+ * 1. WINDOW_ACTIVATED for this EmbeddedFrame
+ * 2. WINDOW_GAINED_FOCUS for this EmbeddedFrame
+ * 3. FOCUS_GAINED for the most recent focus owner in this EmbeddedFrame
+ *
+ * The caller must not requestFocus on the EmbeddedFrame together with calling this method.
+ *
+ * @param parentWindowActive true if the window is activated, false otherwise
+ */
// handleWindowFocusEvent is called for all applets, when the browser
- // becames active/inactive. This event should be filtered out for
+ // becomes active/inactive. This event should be filtered out for
// non-focused applet. This method can be called from different threads.
public void handleWindowFocusEvent(boolean parentWindowActive) {
this.parentWindowActive = parentWindowActive;
diff --git a/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java b/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
index eab279193dd13d9f5c44dcaba0430fadd114b513..7230b2eeeb5d5457f3fbe81451682c7d644ea2dd 100644
--- a/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
+++ b/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
@@ -812,8 +812,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
throw new RuntimeException("Unknown window state: " + windowState);
}
- nativeSynthesizeMouseEnteredExitedEvents();
-
// NOTE: the SWP.windowState field gets updated to the newWindowState
// value when the native notification comes to us
}
diff --git a/src/macosx/native/com/apple/laf/AquaFileView.m b/src/macosx/native/com/apple/laf/AquaFileView.m
index 8f33cc5da8c7bd49d546e9bf449dade0a470f2a2..65fcc72abd3be44a39153b44a067a58de362b4c4 100644
--- a/src/macosx/native/com/apple/laf/AquaFileView.m
+++ b/src/macosx/native/com/apple/laf/AquaFileView.m
@@ -187,13 +187,13 @@ JNIEXPORT jstring JNICALL Java_com_apple_laf_AquaFileView_getNativePathForResolv
JNF_COCOA_ENTER(env);
UInt8 pathCString[MAXPATHLEN + 1];
- size_t pathSize = sizeof(pathCString);
+ size_t maxPathLen = sizeof(pathCString) - 1;
jbyte *byteArray = (*env)->GetByteArrayElements(env, pathToAlias, NULL);
jsize length = (*env)->GetArrayLength(env, pathToAlias);
- if (length > pathSize) {
- length = pathSize;
+ if (length > maxPathLen) {
+ length = maxPathLen;
}
strncpy((char *)pathCString, (char *)byteArray, length);
// make sure it's null terminated
diff --git a/src/macosx/native/sun/awt/AWTEvent.m b/src/macosx/native/sun/awt/AWTEvent.m
index fd3caa6051f28bf5aa94ec56d0b3ef91a7951ebe..b2d54f7e7053c40afba41e8b5034ac5ec736a5d9 100644
--- a/src/macosx/native/sun/awt/AWTEvent.m
+++ b/src/macosx/native/sun/awt/AWTEvent.m
@@ -382,7 +382,7 @@ static unichar NsGetDeadKeyChar(unsigned short keyCode)
{
TISInputSourceRef currentKeyboard = TISCopyCurrentKeyboardInputSource();
CFDataRef uchr = (CFDataRef)TISGetInputSourceProperty(currentKeyboard, kTISPropertyUnicodeKeyLayoutData);
- if (uchr == nil) { return; }
+ if (uchr == nil) { return 0; }
const UCKeyboardLayout *keyboardLayout = (const UCKeyboardLayout*)CFDataGetBytePtr(uchr);
// Carbon modifiers should be used instead of NSEvent modifiers
UInt32 modifierKeyState = (GetCurrentEventKeyModifiers() >> 8) & 0xFF;
diff --git a/src/macosx/native/sun/awt/AWTWindow.m b/src/macosx/native/sun/awt/AWTWindow.m
index 2997ff4de7560c2306fe25a3664fdbcdbc30788b..2a596bcfa75bb6abe62d046a15f01efb65c0d3c4 100644
--- a/src/macosx/native/sun/awt/AWTWindow.m
+++ b/src/macosx/native/sun/awt/AWTWindow.m
@@ -447,6 +447,8 @@ AWT_ASSERT_APPKIT_THREAD;
// TODO: create generic AWT assert
}
+ [AWTWindow synthesizeMouseEnteredExitedEventsForAllWindows];
+
NSRect frame = ConvertNSScreenRect(env, [self.nsWindow frame]);
static JNF_MEMBER_CACHE(jm_deliverMoveResizeEvent, jc_CPlatformWindow, "deliverMoveResizeEvent", "(IIIIZ)V");
@@ -630,6 +632,7 @@ AWT_ASSERT_APPKIT_THREAD;
[self _notifyFullScreenOp:com_apple_eawt_FullScreenHandler_FULLSCREEN_DID_ENTER withEnv:env];
(*env)->DeleteLocalRef(env, platformWindow);
}
+ [AWTWindow synthesizeMouseEnteredExitedEventsForAllWindows];
}
- (void)windowWillExitFullScreen:(NSNotification *)notification {
@@ -652,6 +655,7 @@ AWT_ASSERT_APPKIT_THREAD;
[self _notifyFullScreenOp:com_apple_eawt_FullScreenHandler_FULLSCREEN_DID_EXIT withEnv:env];
(*env)->DeleteLocalRef(env, platformWindow);
}
+ [AWTWindow synthesizeMouseEnteredExitedEventsForAllWindows];
}
- (void)sendEvent:(NSEvent *)event {
@@ -891,8 +895,6 @@ JNF_COCOA_ENTER(env);
// ensure we repaint the whole window after the resize operation
// (this will also re-enable screen updates, which were disabled above)
// TODO: send PaintEvent
-
- [AWTWindow synthesizeMouseEnteredExitedEventsForAllWindows];
}];
JNF_COCOA_EXIT(env);
diff --git a/src/share/classes/java/awt/DefaultKeyboardFocusManager.java b/src/share/classes/java/awt/DefaultKeyboardFocusManager.java
index 1358908528b11ba7c7e8b2f4c2e7a2ae737a193e..7c0c39d8ffa81e70323a3d823de427db8dd98ade 100644
--- a/src/share/classes/java/awt/DefaultKeyboardFocusManager.java
+++ b/src/share/classes/java/awt/DefaultKeyboardFocusManager.java
@@ -285,10 +285,17 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
TimedWindowEvent we = (TimedWindowEvent)e;
long time = we.getWhen();
synchronized (this) {
- for (KeyEvent ke: enqueuedKeyEvents) {
- if (time >= ke.getWhen()) {
- SunToolkit.postEvent(AppContext.getAppContext(), new SequencedEvent(e));
- return true;
+ KeyEvent ke = enqueuedKeyEvents.isEmpty() ? null : enqueuedKeyEvents.getFirst();
+ if (ke != null && time >= ke.getWhen()) {
+ TypeAheadMarker marker = typeAheadMarkers.getFirst();
+ if (marker != null) {
+ Window toplevel = marker.untilFocused.getContainingWindow();
+ // Check that the component awaiting focus belongs to
+ // the current focused window. See 8015454.
+ if (toplevel != null && toplevel.isFocused()) {
+ SunToolkit.postEvent(AppContext.getAppContext(), new SequencedEvent(e));
+ return true;
+ }
}
}
}
diff --git a/src/share/classes/java/awt/color/ICC_Profile.java b/src/share/classes/java/awt/color/ICC_Profile.java
index b459f63b16d40ae5c98bcceb344f35b226781026..c1534249f391a14a30d261e81b3810920a27ffda 100644
--- a/src/share/classes/java/awt/color/ICC_Profile.java
+++ b/src/share/classes/java/awt/color/ICC_Profile.java
@@ -37,6 +37,7 @@ package java.awt.color;
import sun.java2d.cmm.PCMM;
import sun.java2d.cmm.CMSManager;
+import sun.java2d.cmm.ProfileDataVerifier;
import sun.java2d.cmm.ProfileDeferralMgr;
import sun.java2d.cmm.ProfileDeferralInfo;
import sun.java2d.cmm.ProfileActivator;
@@ -775,6 +776,8 @@ public class ICC_Profile implements Serializable {
ProfileDeferralMgr.activateProfiles();
}
+ ProfileDataVerifier.verify(data);
+
try {
theID = CMSManager.getModule().loadProfile(data);
} catch (CMMException c) {
diff --git a/src/share/classes/java/beans/XMLEncoder.java b/src/share/classes/java/beans/XMLEncoder.java
index 2ac3cdc30b29e82a4c8364f6ec42b4fbda8e6d9f..b7cc21de31288341f313f0bc5e76ddebee7e38b0 100644
--- a/src/share/classes/java/beans/XMLEncoder.java
+++ b/src/share/classes/java/beans/XMLEncoder.java
@@ -377,7 +377,7 @@ public class XMLEncoder extends Encoder implements AutoCloseable {
Object arg = args[i];
mark(arg, true);
}
- mark(stm.getTarget(), false);
+ mark(stm.getTarget(), stm instanceof Expression);
}
diff --git a/src/share/classes/java/lang/Thread.java b/src/share/classes/java/lang/Thread.java
index d97f03d4e24f5e71ecea94115d44f82b81b7160e..c07fde2f291919140138171076e03ee30390b36a 100644
--- a/src/share/classes/java/lang/Thread.java
+++ b/src/share/classes/java/lang/Thread.java
@@ -2013,12 +2013,21 @@ class Thread implements Runnable {
// The following three initially uninitialized fields are exclusively
- // managed by class java.util.concurrent.ThreadLocalRandom.
+ // managed by class java.util.concurrent.ThreadLocalRandom. These
+ // fields are used to build the high-performance PRNGs in the
+ // concurrent code, and we can not risk accidental false sharing.
+ // Hence, the fields are isolated with @Contended.
+
/** The current seed for a ThreadLocalRandom */
+ @sun.misc.Contended("tlr")
long threadLocalRandomSeed;
+
/** Probe hash value; nonzero if threadLocalRandomSeed initialized */
+ @sun.misc.Contended("tlr")
int threadLocalRandomProbe;
+
/** Secondary seed isolated from public ThreadLocalRandom sequence */
+ @sun.misc.Contended("tlr")
int threadLocalRandomSecondarySeed;
/* Some private helper methods */
diff --git a/src/share/classes/java/lang/instrument/Instrumentation.java b/src/share/classes/java/lang/instrument/Instrumentation.java
index 1844837fd3b2d6172dff9699a1c31d2399fdd88b..4cdb2de9c9aac0819d1d7d4ae0eefb3ce5bc48d7 100644
--- a/src/share/classes/java/lang/instrument/Instrumentation.java
+++ b/src/share/classes/java/lang/instrument/Instrumentation.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
@@ -363,6 +363,8 @@ public interface Instrumentation {
* Primitive classes (for example, java.lang.Integer.TYPE)
* and array classes are never modifiable.
*
+ * @param theClass the class to check for being modifiable
+ * @return whether or not the argument class is modifiable
* @throws java.lang.NullPointerException if the specified class is null.
*
* @see #retransformClasses
@@ -549,14 +551,14 @@ public interface Instrumentation {
* {@link java.lang.instrument.ClassFileTransformer ClassFileTransformer},
* it enables native methods to be
* instrumented.
- *
+ *
* Since native methods cannot be directly instrumented
* (they have no bytecodes), they must be wrapped with
* a non-native method which can be instrumented.
* For example, if we had:
*
* native boolean foo(int x);
- *
+ *
* We could transform the class file (with the
* ClassFileTransformer during the initial definition
* of the class) so that this becomes:
@@ -567,14 +569,14 @@ public interface Instrumentation {
* }
*
* native boolean wrapped_foo(int x);
- *
+ *
* Where foo becomes a wrapper for the actual native
* method with the appended prefix "wrapped_". Note that
* "wrapped_" would be a poor choice of prefix since it
* might conceivably form the name of an existing method
* thus something like "$$$MyAgentWrapped$$$_" would be
* better but would make these examples less readable.
- *
+ *
* The wrapper will allow data to be collected on the native
* method call, but now the problem becomes linking up the
* wrapped method with the native implementation.
@@ -583,7 +585,7 @@ public interface Instrumentation {
* which might be:
*
* This function allows the prefix to be specified and the
* proper resolution to occur.
* Specifically, when the standard resolution fails, the
@@ -596,29 +598,29 @@ public interface Instrumentation {
*
* When this fails, the resolution will be retried with
* the specified prefix deleted from the implementation name,
* yielding the correct resolution:
*
* Note that since the prefix is only used when standard
* resolution fails, native methods can be wrapped selectively.
- *
+ *
* Since each ClassFileTransformer
* can do its own transformation of the bytecodes, more
* than one layer of wrappers may be applied. Thus each
diff --git a/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java b/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java
index 16703fc09177dfd3dc1bb2876f4a5fb0ee8c9ec0..0b6f4016b1d3c8c92d00c7d8ec4c964661c06f42 100644
--- a/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java
+++ b/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java
@@ -112,7 +112,9 @@ import java.security.PrivilegedAction;
implMethodDesc = implMethodType.toMethodDescriptorString();
Type implMethodAsmType = Type.getMethodType(implMethodDesc);
implMethodArgumentTypes = implMethodAsmType.getArgumentTypes();
- implMethodReturnType = implMethodAsmType.getReturnType();
+ implMethodReturnType = (implKind == MethodHandleInfo.REF_newInvokeSpecial)
+ ? Type.getObjectType(implMethodClassName)
+ : implMethodAsmType.getReturnType();
constructorType = invokedType.changeReturnType(Void.TYPE);
constructorDesc = constructorType.toMethodDescriptorString();
lambdaClassName = targetClass.getName().replace('.', '/') + "$$Lambda$" + counter.incrementAndGet();
diff --git a/src/share/classes/java/lang/invoke/LambdaConversionException.java b/src/share/classes/java/lang/invoke/LambdaConversionException.java
index 11ffb580ea944c40b90a734ed9799d77db634672..5cc3c626e363c407031fbc118093780450788fe5 100644
--- a/src/share/classes/java/lang/invoke/LambdaConversionException.java
+++ b/src/share/classes/java/lang/invoke/LambdaConversionException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -29,21 +29,45 @@ package java.lang.invoke;
* LambdaConversionException
*/
public class LambdaConversionException extends Exception {
+ /**
+ * 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/src/share/classes/java/lang/invoke/LambdaMetafactory.java b/src/share/classes/java/lang/invoke/LambdaMetafactory.java
index d179d438e8a2d304e995b1918f83452fe9b374c1..e03dda002d1217d970e8cda1a0a32d90f01724d3 100644
--- a/src/share/classes/java/lang/invoke/LambdaMetafactory.java
+++ b/src/share/classes/java/lang/invoke/LambdaMetafactory.java
@@ -111,7 +111,7 @@ package java.lang.invoke;
* done on return type, while a strict version is applied to arguments.
*
*
A type Q is considered adaptable to S as follows:
- *
+ *
*
Q
S
Link-time checks
Capture-time checks
*
*
Primitive
Primitive
@@ -155,7 +155,7 @@ public class LambdaMetafactory {
private static final Class>[] EMPTY_CLASS_ARRAY = new Class>[0];
-/**
+ /**
* Standard meta-factory for conversion of lambda expressions or method references to functional interfaces.
*
* @param caller Stacked automatically by VM; represents a lookup context with the accessibility privileges
@@ -174,7 +174,7 @@ public class LambdaMetafactory {
* @param instantiatedMethodType The signature of the primary functional interface method after type variables
* are substituted with their instantiation from the capture site
* @return a CallSite, which, when invoked, will return an instance of the functional interface
- * @throws ReflectiveOperationException
+ * @throws ReflectiveOperationException if the caller is not able to reconstruct one of the method handles
* @throws LambdaConversionException If any of the meta-factory protocol invariants are violated
*/
public static CallSite metaFactory(MethodHandles.Lookup caller,
@@ -226,7 +226,7 @@ public class LambdaMetafactory {
* the first argument in the invocation signature will correspond to the receiver.
* @param args argument to pass, flags, marker interface count, and marker interfaces as described above
* @return a CallSite, which, when invoked, will return an instance of the functional interface
- * @throws ReflectiveOperationException
+ * @throws ReflectiveOperationException if the caller is not able to reconstruct one of the method handles
* @throws LambdaConversionException If any of the meta-factory protocol invariants are violated
*/
public static CallSite altMetaFactory(MethodHandles.Lookup caller,
diff --git a/src/share/classes/java/lang/invoke/MethodHandle.java b/src/share/classes/java/lang/invoke/MethodHandle.java
index 06084056fb4edb6d2a648cb1cac082e7f3a9b5f3..df784d35e5b6be8a1098c97ee0ae5f92a8cbf96b 100644
--- a/src/share/classes/java/lang/invoke/MethodHandle.java
+++ b/src/share/classes/java/lang/invoke/MethodHandle.java
@@ -44,7 +44,7 @@ import java.util.logging.Logger;
* {@linkplain java.lang.invoke.MethodHandles#dropArguments deletion},
* and {@linkplain java.lang.invoke.MethodHandles#filterArguments substitution}.
*
- *
Method handle contents
+ *
Method handle contents
* 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
@@ -81,7 +81,7 @@ import java.util.logging.Logger;
* from its specific class, as the method handle class hierarchy (if any)
* may change from time to time or across implementations from different vendors.
*
- *
Method handle compilation
+ *
Method handle compilation
* 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
@@ -111,7 +111,7 @@ import java.util.logging.Logger;
* The ambiguity with the type {@code Void} is harmless, since there are no references of type
* {@code Void} except the null reference.
*
- *
Method handle invocation
+ *
Method handle invocation
* 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.
@@ -154,7 +154,7 @@ import java.util.logging.Logger;
* (Note: The adjusted method handle {@code M2} is not directly observable,
* and implementations are therefore not required to materialize it.)
*
- *
Invocation checking
+ *
Invocation checking
* 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
@@ -195,7 +195,7 @@ import java.util.logging.Logger;
* They should not be passed to untrusted code unless their use from
* the untrusted code would be harmless.
*
- *
Method handle creation
+ *
Method handle creation
* 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
@@ -249,7 +249,7 @@ import java.util.logging.Logger;
* receiver type. Such a method handle simulates the effect of
* an {@code invokespecial} instruction to the same method.
*
- *
Usage examples
+ *
Usage examples
* Here are some examples of usage:
*
{@code
Object x, y; String s; int i;
@@ -295,7 +295,7 @@ mh.invokeExact(System.out, "Hello, world.");
* be a method which calls {@link java.util.Objects#equals(Object,Object) Objects.equals }
* on its arguments, and asserts that the result is true.
*
- *
Exceptions
+ *
Exceptions
* 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
@@ -308,7 +308,7 @@ mh.invokeExact(System.out, "Hello, world.");
* throwables locally, rethrowing only those which are legal in the context,
* and wrapping ones which are illegal.
*
- *
Signature polymorphism
+ *
Signature polymorphism
* The unusual compilation and linkage behavior of
* {@code invokeExact} and plain {@code invoke}
* is referenced by the term signature polymorphism.
@@ -333,7 +333,7 @@ mh.invokeExact(System.out, "Hello, world.");
* Tools which determine symbolic linkage are required to accept such
* untransformed descriptors, without reporting linkage errors.
*
- *
Interoperation between method handles and the Core Reflection API
+ *
Interoperation between method handles and the Core Reflection API
* Using factory methods in the {@link 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.
@@ -375,7 +375,7 @@ mh.invokeExact(System.out, "Hello, world.");
* to call {@code invokeExact} or plain {@code invoke},
* for any specified type descriptor .
*
- *
Interoperation between method handles and Java generics
+ *
Interoperation between method handles and Java generics
* 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
@@ -457,6 +457,8 @@ public abstract class MethodHandle {
* {@link java.lang.reflect.Method#invoke java.lang.reflect.Method.invoke}, via JNI,
* or indirectly via {@link 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
*/
@@ -491,6 +493,8 @@ public abstract class MethodHandle {
* {@link java.lang.reflect.Method#invoke java.lang.reflect.Method.invoke}, via JNI,
* or indirectly via {@link 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
@@ -511,15 +515,26 @@ public abstract class MethodHandle {
* operations on outgoing argument values.)
* The caller can assume that the incoming result value is part of the range
* of the callee's return type.
+ * @param args the signature-polymorphic parameter list, statically represented using varargs
+ * @return the signature-polymorphic result, statically represented using {@code Object}
*/
/*non-public*/ final native @PolymorphicSignature Object invokeBasic(Object... args) throws Throwable;
+ /**
+ * Private method for trusted invocation of a MemberName of kind {@code REF_invokeVirtual}.
+ * The caller signature is restricted to basic types as with {@code invokeBasic}.
+ * The trailing (not leading) argument must be a MemberName.
+ * @param args the signature-polymorphic parameter list, statically represented using varargs
+ * @return the signature-polymorphic result, statically represented using {@code Object}
+ */
/*non-public*/ static native @PolymorphicSignature Object linkToVirtual(Object... args) throws Throwable;
/**
* Private method for trusted invocation of a MemberName of kind {@code REF_invokeStatic}.
* The caller signature is restricted to basic types as with {@code invokeBasic}.
* The trailing (not leading) argument must be a MemberName.
+ * @param args the signature-polymorphic parameter list, statically represented using varargs
+ * @return the signature-polymorphic result, statically represented using {@code Object}
*/
/*non-public*/ static native @PolymorphicSignature Object linkToStatic(Object... args) throws Throwable;
@@ -527,6 +542,8 @@ public abstract class MethodHandle {
* Private method for trusted invocation of a MemberName of kind {@code REF_invokeSpecial}.
* The caller signature is restricted to basic types as with {@code invokeBasic}.
* The trailing (not leading) argument must be a MemberName.
+ * @param args the signature-polymorphic parameter list, statically represented using varargs
+ * @return the signature-polymorphic result, statically represented using {@code Object}
*/
/*non-public*/ static native @PolymorphicSignature Object linkToSpecial(Object... args) throws Throwable;
@@ -534,6 +551,8 @@ public abstract class MethodHandle {
* Private method for trusted invocation of a MemberName of kind {@code REF_invokeInterface}.
* The caller signature is restricted to basic types as with {@code invokeBasic}.
* The trailing (not leading) argument must be a MemberName.
+ * @param args the signature-polymorphic parameter list, statically represented using varargs
+ * @return the signature-polymorphic result, statically represented using {@code Object}
*/
/*non-public*/ static native @PolymorphicSignature Object linkToInterface(Object... args) throws Throwable;
diff --git a/src/share/classes/java/lang/invoke/MethodHandleProxies.java b/src/share/classes/java/lang/invoke/MethodHandleProxies.java
index 641f2eeea510099a234ffe0364ea05ab8984f4e0..246160cabafdb8879432423b6367348bd18d789f 100644
--- a/src/share/classes/java/lang/invoke/MethodHandleProxies.java
+++ b/src/share/classes/java/lang/invoke/MethodHandleProxies.java
@@ -108,8 +108,9 @@ public class MethodHandleProxies {
* Future versions of this API may also equip wrapper instances
* with one or more additional public "marker" interfaces.
*
+ * @param the desired type of the wrapper, a single-method interface
+ * @param intfc a class object representing {@code T}
* @param target the method handle to invoke from the wrapper
- * @param intfc the desired type of the wrapper, a single-method interface
* @return a correctly-typed wrapper for the given target
* @throws NullPointerException if either argument is null
* @throws IllegalArgumentException if the {@code intfc} is not a
diff --git a/src/share/classes/java/lang/invoke/MethodHandles.java b/src/share/classes/java/lang/invoke/MethodHandles.java
index d37c8e947d8816a655ddccfdc45ddfd01a95c9d0..3bf24bc85039cd16630bd7bde128af127532eea0 100644
--- a/src/share/classes/java/lang/invoke/MethodHandles.java
+++ b/src/share/classes/java/lang/invoke/MethodHandles.java
@@ -70,6 +70,7 @@ public class MethodHandles {
* including direct method handles to private fields and methods.
* This lookup object is a capability which may be delegated to trusted agents.
* Do not store it in place where untrusted code can access it.
+ * @return a lookup object for the caller of this method
*/
@CallerSensitive
public static Lookup lookup() {
@@ -88,6 +89,7 @@ public class MethodHandles {
* {@linkplain Lookup#in publicLookup().in(C.class)}.
* Since all classes have equal access to public names,
* such a change would confer no new access rights.
+ * @return a lookup object which is trusted minimally
*/
public static Lookup publicLookup() {
return Lookup.PUBLIC_LOOKUP;
@@ -111,72 +113,74 @@ public class MethodHandles {
* on the {@code Lookup} object to create method handles for access-checked members.
* This includes all methods, constructors, and fields which are allowed to the lookup class,
* even private ones.
- *
+ *
+ *
Lookup Factory Methods
* The factory methods on a {@code Lookup} object correspond to all major
* use cases for methods, constructors, and fields.
* Here is a summary of the correspondence between these factory methods and
* the behavior the resulting method handles:
- *
*
- *
+ *
* Here, the type {@code C} is the class or interface being searched for a member,
* documented as a parameter named {@code refc} in the lookup methods.
- * The method or constructor type {@code MT} is composed from the return type {@code T}
+ * The method type {@code MT} is composed from the return type {@code T}
* and the sequence of argument types {@code A*}.
+ * The constructor also has a sequence of argument types {@code A*} and
+ * is deemed to return the newly-created object of type {@code C}.
* Both {@code MT} and the field type {@code FT} are documented as a parameter named {@code type}.
* The formal parameter {@code this} stands for the self-reference of type {@code C};
* if it is present, it is always the leading argument to the method handle invocation.
@@ -210,7 +214,7 @@ public class MethodHandles {
* security manager checks.
*
*
- *
Access checking
+ *
Access checking
* Access checks are applied in the factory methods of {@code Lookup},
* when a method handle is created.
* This is a key difference from the Core Reflection API, since
@@ -297,7 +301,7 @@ public class MethodHandles {
* with static methods of {@link MethodHandles},
* independently of any {@code Lookup} object.
*
- *
Security manager interactions
+ *
Security manager interactions
*
* If a security manager is present, member lookups are subject to
* additional checks.
@@ -388,6 +392,7 @@ public class MethodHandles {
* but the permissions may be additionally limited by the bitmask
* {@link #lookupModes lookupModes}, which controls whether non-public members
* can be accessed.
+ * @return the lookup class, on behalf of which this lookup object finds members
*/
public Class> lookupClass() {
return lookupClass;
@@ -414,6 +419,7 @@ public class MethodHandles {
* The purpose of this is to restrict access via the new lookup object,
* so that it can access only names which can be reached by the original
* lookup object, and also by the new lookup class.
+ * @return the lookup modes, which limit the kinds of access performed by this lookup object
*/
public int lookupModes() {
return allowedModes & ALL_MODES;
@@ -1352,6 +1358,7 @@ return mh1;
* The type of the method handle will have a void return type.
* Its last argument will be the array's element type.
* The first and second arguments will be the array type and int.
+ * @param arrayClass the class of an array
* @return a method handle which can store values into the array type
* @throws NullPointerException if the argument is null
* @throws IllegalArgumentException if arrayClass is not an array type
@@ -1580,12 +1587,12 @@ import static java.lang.invoke.MethodType.*;
...
MethodType intfn1 = methodType(int.class, int.class);
MethodType intfn2 = methodType(int.class, int.class, int.class);
-MethodHandle sub = ... {int x, int y => x-y} ...;
+MethodHandle sub = ... (int x, int y) -> (x-y) ...;
assert(sub.type().equals(intfn2));
MethodHandle sub1 = permuteArguments(sub, intfn2, 0, 1);
MethodHandle rsub = permuteArguments(sub, intfn2, 1, 0);
assert((int)rsub.invokeExact(1, 100) == 99);
-MethodHandle add = ... {int x, int y => x+y} ...;
+MethodHandle add = ... (int x, int y) -> (x+y) ...;
assert(add.type().equals(intfn2));
MethodHandle twice = permuteArguments(add, intfn1, 0, 0);
assert(twice.type().equals(intfn1));
@@ -2261,6 +2268,8 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
* The method type will nominally specify a return of {@code returnType}.
* The return type may be anything convenient: It doesn't matter to the
* method handle's behavior, since it will never return normally.
+ * @param returnType the return type of the desired method handle
+ * @param exType the parameter type of the desired method handle
* @return method handle which can throw the given exceptions
* @throws NullPointerException if either argument is null
*/
diff --git a/src/share/classes/java/lang/invoke/MethodType.java b/src/share/classes/java/lang/invoke/MethodType.java
index 7c9f2450840b430552545b591d1ce15c76c6c6e3..f55479f1345a784007b9f4e6896345aa9392df15 100644
--- a/src/share/classes/java/lang/invoke/MethodType.java
+++ b/src/share/classes/java/lang/invoke/MethodType.java
@@ -194,6 +194,8 @@ class MethodType implements java.io.Serializable {
/**
* Finds or creates a method type with the given components.
* Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
+ * @param rtype the return type
+ * @param ptypes the parameter types
* @return a method type with the given components
* @throws NullPointerException if {@code rtype} or {@code ptypes} or any element of {@code ptypes} is null
* @throws IllegalArgumentException if any element of {@code ptypes} is {@code void.class}
@@ -214,6 +216,9 @@ class MethodType implements java.io.Serializable {
* Finds or creates a method type with the given components.
* Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
* The leading parameter type is prepended to the remaining array.
+ * @param rtype the return type
+ * @param ptype0 the first parameter type
+ * @param ptypes the remaining parameter types
* @return a method type with the given components
* @throws NullPointerException if {@code rtype} or {@code ptype0} or {@code ptypes} or any element of {@code ptypes} is null
* @throws IllegalArgumentException if {@code ptype0} or {@code ptypes} or any element of {@code ptypes} is {@code void.class}
@@ -230,6 +235,7 @@ class MethodType implements java.io.Serializable {
* Finds or creates a method type with the given components.
* Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
* The resulting method has no parameter types.
+ * @param rtype the return type
* @return a method type with the given return value
* @throws NullPointerException if {@code rtype} is null
*/
@@ -242,6 +248,8 @@ class MethodType implements java.io.Serializable {
* Finds or creates a method type with the given components.
* Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
* The resulting method has the single given parameter type.
+ * @param rtype the return type
+ * @param ptype0 the parameter type
* @return a method type with the given return value and parameter type
* @throws NullPointerException if {@code rtype} or {@code ptype0} is null
* @throws IllegalArgumentException if {@code ptype0} is {@code void.class}
@@ -256,6 +264,9 @@ class MethodType implements java.io.Serializable {
* Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
* The resulting method has the same parameter types as {@code ptypes},
* and the specified return type.
+ * @param rtype the return type
+ * @param ptypes the method type which supplies the parameter types
+ * @return a method type with the given components
* @throws NullPointerException if {@code rtype} or {@code ptypes} is null
*/
public static
@@ -938,7 +949,8 @@ s.writeObject(this.parameterArray());
* provided to the factory method {@link #methodType(Class,Class[]) methodType}.
* For example, null values, or {@code void} parameter types,
* will lead to exceptions during deserialization.
- * @param the stream to write the object to
+ * @param s the stream to write the object to
+ * @throws java.io.IOException if there is a problem writing the object
*/
private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
s.defaultWriteObject(); // requires serialPersistentFields to be an empty array
@@ -953,7 +965,9 @@ s.writeObject(this.parameterArray());
* It provides the parameters to the factory method called by
* {@link #readResolve readResolve}.
* After that call it is discarded.
- * @param the stream to read the object from
+ * @param s the stream to read the object from
+ * @throws java.io.IOException if there is a problem reading the object
+ * @throws ClassNotFoundException if one of the component classes cannot be resolved
* @see #MethodType()
* @see #readResolve
* @see #writeObject
diff --git a/src/share/classes/java/lang/invoke/MutableCallSite.java b/src/share/classes/java/lang/invoke/MutableCallSite.java
index d48f99afefbde21e8eea9a16856286b8e696b7bd..37bd4641484e8a2731618c4f309d1243806900e8 100644
--- a/src/share/classes/java/lang/invoke/MutableCallSite.java
+++ b/src/share/classes/java/lang/invoke/MutableCallSite.java
@@ -195,7 +195,7 @@ public class MutableCallSite extends CallSite {
* processed before the method returns abnormally.
* Which elements these are (if any) is implementation-dependent.
*
- *
Java Memory Model details
+ *
Java Memory Model details
* In terms of the Java Memory Model, this operation performs a synchronization
* action which is comparable in effect to the writing of a volatile variable
* by the current thread, and an eventual volatile read by every other thread
diff --git a/src/share/classes/java/lang/invoke/SerializedLambda.java b/src/share/classes/java/lang/invoke/SerializedLambda.java
index 3679e3f726d91716277a1e56db0cd595e0367e88..558fa5ab6ee98610f5a13a257cdae9a27655a819 100644
--- a/src/share/classes/java/lang/invoke/SerializedLambda.java
+++ b/src/share/classes/java/lang/invoke/SerializedLambda.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -97,66 +97,113 @@ public final class SerializedLambda implements Serializable {
this.capturedArgs = Objects.requireNonNull(capturedArgs).clone();
}
- /** Get the name of the class that captured this lambda */
+ /**
+ * Get the name of the class that captured this lambda.
+ * @return the name of the class that captured this lambda
+ */
public String getCapturingClass() {
return capturingClass.getName().replace('.', '/');
}
- /** Get the name of the functional interface class to which this lambda has been converted */
+ /**
+ * Get the name of the functional interface class to which this
+ * lambda has been converted
+ * @return the name of the functional interface this lambda has
+ * been converted to
+ */
public String getFunctionalInterfaceClass() {
return functionalInterfaceClass;
}
- /** Get the name of the primary method for the functional interface to which this lambda has been converted */
+ /**
+ * Get the name of the primary method for the functional interface
+ * to which this lambda has been converted.
+ * @return the name of the primary methods of the functional interface
+ */
public String getFunctionalInterfaceMethodName() {
return functionalInterfaceMethodName;
}
- /** Get the signature of the primary method for the functional interface to which this lambda has been converted */
+ /**
+ * Get the signature of the primary method for the functional
+ * interface to which this lambda has been converted.
+ * @return the signature of the primary method of the functional
+ * interface
+ */
public String getFunctionalInterfaceMethodSignature() {
return functionalInterfaceMethodSignature;
}
- /** Get the method handle kind (see {@link MethodHandleInfo}) of the primary method for the functional interface
- * to which this lambda has been converted */
+ /**
+ * Get the method handle kind (see {@link MethodHandleInfo}) of
+ * the primary method for the functional interface to which this
+ * lambda has been converted
+ * @return the method handle kind of the primary method of
+ * functional interface
+ */
public int getFunctionalInterfaceMethodKind() {
return functionalInterfaceMethodKind;
}
- /** Get the name of the class containing the implementation method */
+ /**
+ * Get the name of the class containing the implementation
+ * method.
+ * @return the name of the class containing the implementation
+ * method
+ */
public String getImplClass() {
return implClass;
}
- /** Get the name of the implementation method */
+ /**
+ * Get the name of the implementation method.
+ * @return the name of the implementation method
+ */
public String getImplMethodName() {
return implMethodName;
}
- /** Get the signature of the implementation method */
+ /**
+ * Get the signature of the implementation method.
+ * @return the signature of the implementation method
+ */
public String getImplMethodSignature() {
return implMethodSignature;
}
- /** Get the method handle kind (see {@link MethodHandleInfo}) of the implementation method */
+ /**
+ * Get the method handle kind (see {@link MethodHandleInfo}) of
+ * the implementation method.
+ * @return the method handle kind of the implementation method
+ */
public int getImplMethodKind() {
return implMethodKind;
}
/**
- * Get the signature of the primary functional interface method after type variables are substituted with
- * their instantiation from the capture site
+ * Get the signature of the primary functional interface method
+ * after type variables are substituted with their instantiation
+ * from the capture site.
+ * @return the signature of the primary functional interface method
+ * after type variable processing
*/
public final String getInstantiatedMethodType() {
return instantiatedMethodType;
}
- /** Get the count of dynamic arguments to the lambda capture site */
+ /**
+ * Get the count of dynamic arguments to the lambda capture site.
+ * @return the count of dynamic arguments to the lambda capture site
+ */
public int getCapturedArgCount() {
return capturedArgs.length;
}
- /** Get a dynamic argument to the lambda capture site */
+ /**
+ * Get a dynamic argument to the lambda capture site.
+ * @param i the argument to capture
+ * @return a dynamic argument to the lambda capture site
+ */
public Object getCapturedArg(int i) {
return capturedArgs[i];
}
diff --git a/src/share/classes/java/lang/invoke/package-info.java b/src/share/classes/java/lang/invoke/package-info.java
index 880bf54021f622ae72f6a067818a672f5c282ffb..51fc21c3f7760841e8d90f870c45e96736ab6fb0 100644
--- a/src/share/classes/java/lang/invoke/package-info.java
+++ b/src/share/classes/java/lang/invoke/package-info.java
@@ -43,13 +43,13 @@
*
*
*
- *
Summary of relevant Java Virtual Machine changes
+ *
Summary of relevant Java Virtual Machine changes
* The following low-level information summarizes relevant parts of the
* Java Virtual Machine specification. For full details, please see the
* current version of that specification.
*
* Each occurrence of an {@code invokedynamic} instruction is called a dynamic call site.
- *
{@code invokedynamic} instructions
+ *
{@code invokedynamic} instructions
* A dynamic call site is originally in an unlinked state. In this state, there is
* no target method for the call site to invoke.
*
@@ -97,7 +97,7 @@
* If this happens, the same error will the thrown for all subsequent
* attempts to execute the dynamic call site.
*
- *
timing of linkage
+ *
timing of linkage
* A dynamic call site is linked just before its first execution.
* The bootstrap method call implementing the linkage occurs within
* a thread that is attempting a first execution.
@@ -131,7 +131,7 @@
* just before its first invocation.
* There is no way to undo the effect of a completed bootstrap method call.
*
- *
types of bootstrap methods
+ *
types of bootstrap methods
* As long as each bootstrap method can be correctly invoked
* by {@code MethodHandle.invoke}, its detailed type is arbitrary.
* For example, the first argument could be {@code Object}
diff --git a/src/share/classes/java/math/BigDecimal.java b/src/share/classes/java/math/BigDecimal.java
index d2a449223788b216af347c029ae0693cd82ea5f9..944f8a79fbe9faf983b9e1a01d613e768b10b2e2 100644
--- a/src/share/classes/java/math/BigDecimal.java
+++ b/src/share/classes/java/math/BigDecimal.java
@@ -2572,6 +2572,9 @@ public class BigDecimal extends Number implements Comparable {
* ({@code this} * 10n). The scale of
* the result is {@code (this.scale() - n)}.
*
+ * @param n the exponent power of ten to scale by
+ * @return a BigDecimal whose numerical value is equal to
+ * ({@code this} * 10n)
* @throws ArithmeticException if the scale would be
* outside the range of a 32-bit integer.
*
diff --git a/src/share/classes/java/math/BigInteger.java b/src/share/classes/java/math/BigInteger.java
index 8972ac76ef9e054a6e6339cac16aa268062444a5..6569fcb1796b25bfe8f9fa843107986b5f9b2bf5 100644
--- a/src/share/classes/java/math/BigInteger.java
+++ b/src/share/classes/java/math/BigInteger.java
@@ -33,6 +33,7 @@ import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectStreamField;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;
import sun.misc.DoubleConsts;
@@ -213,6 +214,16 @@ public class BigInteger extends Number implements Comparable {
*/
private static final int TOOM_COOK_SQUARE_THRESHOLD = 140;
+ /**
+ * The threshold value for using Schoenhage recursive base conversion. If
+ * the number of ints in the number are larger than this value,
+ * the Schoenhage algorithm will be used. In practice, it appears that the
+ * Schoenhage routine is faster for any threshold down to 2, and is
+ * relatively flat for thresholds between 2-25, so this choice may be
+ * varied within this range for very small effect.
+ */
+ private static final int SCHOENHAGE_BASE_CONVERSION_THRESHOLD = 8;
+
//Constructors
/**
@@ -1026,6 +1037,19 @@ public class BigInteger extends Number implements Comparable {
private static BigInteger posConst[] = new BigInteger[MAX_CONSTANT+1];
private static BigInteger negConst[] = new BigInteger[MAX_CONSTANT+1];
+ /**
+ * The cache of powers of each radix. This allows us to not have to
+ * recalculate powers of radix^(2^n) more than once. This speeds
+ * Schoenhage recursive base conversion significantly.
+ */
+ private static volatile BigInteger[][] powerCache;
+
+ /** The cache of logarithms of radices for base conversion. */
+ private static final double[] logCache;
+
+ /** The natural log of 2. This is used in computing cache indices. */
+ private static final double LOG_TWO = Math.log(2.0);
+
static {
for (int i = 1; i <= MAX_CONSTANT; i++) {
int[] magnitude = new int[1];
@@ -1033,6 +1057,20 @@ public class BigInteger extends Number implements Comparable {
posConst[i] = new BigInteger(magnitude, 1);
negConst[i] = new BigInteger(magnitude, -1);
}
+
+ /*
+ * Initialize the cache of radix^(2^x) values used for base conversion
+ * with just the very first value. Additional values will be created
+ * on demand.
+ */
+ powerCache = new BigInteger[Character.MAX_RADIX+1][];
+ logCache = new double[Character.MAX_RADIX+1];
+
+ for (int i=Character.MIN_RADIX; i<=Character.MAX_RADIX; i++)
+ {
+ powerCache[i] = new BigInteger[] { BigInteger.valueOf(i) };
+ logCache[i] = Math.log(i);
+ }
}
/**
@@ -1357,7 +1395,7 @@ public class BigInteger extends Number implements Comparable {
if ((xlen < TOOM_COOK_THRESHOLD) && (ylen < TOOM_COOK_THRESHOLD))
return multiplyKaratsuba(this, val);
else
- return multiplyToomCook3(this, val);
+ return multiplyToomCook3(this, val);
}
private static BigInteger multiplyByInt(int[] x, int y, int sign) {
@@ -3299,6 +3337,28 @@ public class BigInteger extends Number implements Comparable {
if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX)
radix = 10;
+ // If it's small enough, use smallToString.
+ if (mag.length <= SCHOENHAGE_BASE_CONVERSION_THRESHOLD)
+ return smallToString(radix);
+
+ // Otherwise use recursive toString, which requires positive arguments.
+ // The results will be concatenated into this StringBuilder
+ StringBuilder sb = new StringBuilder();
+ if (signum < 0) {
+ toString(this.negate(), sb, radix, 0);
+ sb.insert(0, '-');
+ }
+ else
+ toString(this, sb, radix, 0);
+
+ return sb.toString();
+ }
+
+ /** This method is used to perform toString when arguments are small. */
+ private String smallToString(int radix) {
+ if (signum == 0)
+ return "0";
+
// Compute upper bound on number of digit groups and allocate space
int maxNumDigitGroups = (4*mag.length + 6)/7;
String digitGroup[] = new String[maxNumDigitGroups];
@@ -3337,6 +3397,81 @@ public class BigInteger extends Number implements Comparable {
return buf.toString();
}
+ /**
+ * Converts the specified BigInteger to a string and appends to
+ * sb. This implements the recursive Schoenhage algorithm
+ * for base conversions.
+ *
+ * See Knuth, Donald, _The Art of Computer Programming_, Vol. 2,
+ * Answers to Exercises (4.4) Question 14.
+ *
+ * @param u The number to convert to a string.
+ * @param sb The StringBuilder that will be appended to in place.
+ * @param radix The base to convert to.
+ * @param digits The minimum number of digits to pad to.
+ */
+ private static void toString(BigInteger u, StringBuilder sb, int radix,
+ int digits) {
+ /* If we're smaller than a certain threshold, use the smallToString
+ method, padding with leading zeroes when necessary. */
+ if (u.mag.length <= SCHOENHAGE_BASE_CONVERSION_THRESHOLD) {
+ String s = u.smallToString(radix);
+
+ // Pad with internal zeros if necessary.
+ // Don't pad if we're at the beginning of the string.
+ if ((s.length() < digits) && (sb.length() > 0))
+ for (int i=s.length(); i
+ * This could be changed to a more complicated caching method using
+ * Future.
+ */
+ private static BigInteger getRadixConversionCache(int radix, int exponent) {
+ BigInteger[] cacheLine = powerCache[radix]; // volatile read
+ if (exponent < cacheLine.length) {
+ return cacheLine[exponent];
+ }
+
+ int oldLength = cacheLine.length;
+ cacheLine = Arrays.copyOf(cacheLine, exponent + 1);
+ for (int i = oldLength; i <= exponent; i++) {
+ cacheLine[i] = cacheLine[i - 1].pow(2);
+ }
+
+ BigInteger[][] pc = powerCache; // volatile read again
+ if (exponent >= pc[radix].length) {
+ pc = pc.clone();
+ pc[radix] = cacheLine;
+ powerCache = pc; // volatile write, publish
+ }
+ return cacheLine[exponent];
+ }
/* zero[i] is a string of i consecutive zeros. */
private static String zeros[] = new String[64];
diff --git a/src/share/classes/java/math/RoundingMode.java b/src/share/classes/java/math/RoundingMode.java
index 69994a4c316c51146deb93f03f3aded2530b9d94..41493a200e267e3be9a63a093c8870f2761063a1 100644
--- a/src/share/classes/java/math/RoundingMode.java
+++ b/src/share/classes/java/math/RoundingMode.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
@@ -101,6 +101,7 @@ public enum RoundingMode {
*
*
Example:
*
+ *
Rounding mode UP Examples
*
Input Number
*
Input rounded to one digit with {@code UP} rounding
*
5.5
6
@@ -124,6 +125,7 @@ public enum RoundingMode {
*
*
Example:
*
+ *
Rounding mode DOWN Examples
*
Input Number
*
Input rounded to one digit with {@code DOWN} rounding
*
5.5
5
@@ -148,6 +150,7 @@ public enum RoundingMode {
*
*
Example:
*
+ *
Rounding mode CEILING Examples
*
Input Number
*
Input rounded to one digit with {@code CEILING} rounding
*
5.5
6
@@ -172,6 +175,7 @@ public enum RoundingMode {
*
*
Example:
*
+ *
Rounding mode FLOOR Examples
*
Input Number
*
Input rounded to one digit with {@code FLOOR} rounding
*
5.5
5
@@ -198,6 +202,7 @@ public enum RoundingMode {
*
*
Example:
*
+ *
Rounding mode HALF_UP Examples
*
Input Number
*
Input rounded to one digit with {@code HALF_UP} rounding
*
5.5
6
@@ -223,6 +228,7 @@ public enum RoundingMode {
*
*
Example:
*
+ *
Rounding mode HALF_DOWN Examples
*
Input Number
*
Input rounded to one digit with {@code HALF_DOWN} rounding
*
5.5
5
@@ -255,6 +261,7 @@ public enum RoundingMode {
*
*
Example:
*
+ *
Rounding mode HALF_EVEN Examples
*
Input Number
*
Input rounded to one digit with {@code HALF_EVEN} rounding
*
5.5
6
@@ -278,6 +285,7 @@ public enum RoundingMode {
* {@code ArithmeticException} is thrown.
*
Example:
*
+ *
Rounding mode UNNECESSARY Examples
*
Input Number
*
Input rounded to one digit with {@code UNNECESSARY} rounding
*
A buffer's mark is the index to which its position will be reset
* when the {@link #reset reset} method is invoked. The mark is not always
@@ -89,7 +89,7 @@ import java.util.Spliterator;
* {@link InvalidMarkException} to be thrown.
*
*
- *
Invariants
+ *
Invariants
*
*
The following invariant holds for the mark, position, limit, and
* capacity values:
@@ -109,7 +109,7 @@ import java.util.Spliterator;
* to zero.
*
*
- *
Clearing, flipping, and rewinding
+ *
Clearing, flipping, and rewinding
*
*
In addition to methods for accessing the position, limit, and capacity
* values and for marking and resetting, this class also defines the following
@@ -132,7 +132,7 @@ import java.util.Spliterator;
*
*
*
- *
Read-only buffers
+ *
Read-only buffers
*
*
Every buffer is readable, but not every buffer is writable. The
* mutation methods of each buffer class are specified as optional
@@ -143,14 +143,14 @@ import java.util.Spliterator;
* {@link #isReadOnly isReadOnly} method.
*
*
- *
Thread safety
+ *
Thread safety
*
*
Buffers are not safe for use by multiple concurrent threads. If a
* buffer is to be used by more than one thread then access to the buffer
* should be controlled by appropriate synchronization.
*
*
- *
Invocation chaining
+ *
Invocation chaining
*
*
Methods in this class that do not otherwise have a value to return are
* specified to return the buffer upon which they are invoked. This allows
diff --git a/src/share/classes/java/nio/CharBufferSpliterator.java b/src/share/classes/java/nio/CharBufferSpliterator.java
index 19fd8a8f0ba8b858239f107d56769fc12b535b07..5b3977ae7646f2740e3dc2c9ae4b7e10651a4df5 100644
--- a/src/share/classes/java/nio/CharBufferSpliterator.java
+++ b/src/share/classes/java/nio/CharBufferSpliterator.java
@@ -5,7 +5,7 @@
* 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
+ * 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
diff --git a/src/share/classes/java/nio/MappedByteBuffer.java b/src/share/classes/java/nio/MappedByteBuffer.java
index 1d26276f10c344322684b9698a5282b0bd1037b2..25aa60e0b104663068f24bc8f0c7d401ab56aea0 100644
--- a/src/share/classes/java/nio/MappedByteBuffer.java
+++ b/src/share/classes/java/nio/MappedByteBuffer.java
@@ -45,7 +45,7 @@ import sun.misc.Unsafe;
* this program or another. Whether or not such changes occur, and when they
* occur, is operating-system dependent and therefore unspecified.
*
- *
All or part of a mapped byte buffer may become
* inaccessible at any time, for example if the mapped file is truncated. An
* attempt to access an inaccessible region of a mapped byte buffer will not
* change the buffer's content and will cause an unspecified exception to be
diff --git a/src/share/classes/java/nio/X-Buffer.java.template b/src/share/classes/java/nio/X-Buffer.java.template
index c3037adb4d29973f883bc33904138f6b7ad7ffd8..03a7255c16a477dbf52044cf6e41391456b4bc17 100644
--- a/src/share/classes/java/nio/X-Buffer.java.template
+++ b/src/share/classes/java/nio/X-Buffer.java.template
@@ -44,23 +44,23 @@ import java.util.stream.$Streamtype$Stream;
*
*
*
- *
Absolute and relative {@link #get() get} and
- * {@link #put($type$) put} methods that read and write
+ *
Absolute and relative {@link #get() get} and
+ * {@link #put($type$) put} methods that read and write
* single $type$s;
*
- *
Relative {@link #get($type$[])
bulk get}
+ *
Relative {@link #get($type$[]) bulk get}
* methods that transfer contiguous sequences of $type$s from this buffer
* into an array; {#if[!byte]?and}
*
- *
Relative {@link #put($type$[])
bulk put}
+ *
Relative {@link #put($type$[]) bulk put}
* methods that transfer contiguous sequences of $type$s from $a$
* $type$ array{#if[char]?, a string,} or some other $type$
* buffer into this buffer;{#if[!byte]? and}
*
#if[byte]
*
- *
Absolute and relative {@link #getChar()
get}
- * and {@link #putChar(char) put} methods that read and
+ *
Absolute and relative {@link #getChar() get}
+ * and {@link #putChar(char) put} methods that read and
* write values of other primitive types, translating them to and from
* sequences of bytes in a particular byte order;
Methods for {@link #compact compacting}, {@link
+ * #duplicate duplicating}, and {@link #slice slicing}
+ * $a$ $type$ buffer.
*
*
*
*
$Type$ buffers can be created either by {@link #allocate
- * allocation}, which allocates space for the buffer's
+ * allocation}, which allocates space for the buffer's
*
#if[byte]
*
- * content, or by {@link #wrap($type$[]) wrapping} an
+ * content, or by {@link #wrap($type$[]) wrapping} an
* existing $type$ array {#if[char]?or string} into a buffer.
*
#else[byte]
*
- * content, by {@link #wrap($type$[]) wrapping} an existing
+ * content, by {@link #wrap($type$[]) wrapping} an existing
* $type$ array {#if[char]?or string} into a buffer, or by creating a
* view of an existing byte buffer.
*
@@ -94,8 +94,8 @@ import java.util.stream.$Streamtype$Stream;
*
#if[byte]
*
- *
- *
A byte buffer is either direct or non-direct. Given a
* direct byte buffer, the Java virtual machine will make a best effort to
@@ -116,7 +116,7 @@ import java.util.stream.$Streamtype$Stream;
* buffers only when they yield a measureable gain in program performance.
*
*
A direct byte buffer may also be created by {@link
- * java.nio.channels.FileChannel#map
mapping} a region of a file
+ * java.nio.channels.FileChannel#map mapping} a region of a file
* directly into memory. An implementation of the Java platform may optionally
* support the creation of direct byte buffers from native code via JNI. If an
* instance of one of these kinds of buffers refers to an inaccessible region
@@ -129,8 +129,8 @@ import java.util.stream.$Streamtype$Stream;
* that explicit buffer management can be done in performance-critical code.
*
*
- *
- *
This class defines methods for reading and writing values of all other
* primitive types, except boolean. Primitive values are translated
@@ -156,7 +156,7 @@ import java.util.stream.$Streamtype$Stream;
* parameters of the absolute get and put methods are in terms of
* bytes rather than of the type being read or written.
*
- *
+ *
*
*
For access to homogeneous binary data, that is, sequences of values of
* the same type, this class defines methods that can create views of a
@@ -214,7 +214,7 @@ import java.util.stream.$Streamtype$Stream;
#end[char]
*
#if[byte]
- *
Invocation chaining
+ *
Invocation chaining
#end[byte]
*
*
Methods in this class that do not otherwise have a value to return are
@@ -297,7 +297,7 @@ public abstract class $Type$Buffer
*
The new buffer's position will be zero, its limit will be its
* capacity, its mark will be undefined, and each of its elements will be
* initialized to zero. Whether or not it has a
- * {@link #hasArray
backing array} is unspecified.
+ * {@link #hasArray backing array} is unspecified.
*
* @param capacity
* The new buffer's capacity, in $type$s
@@ -318,9 +318,8 @@ public abstract class $Type$Buffer
*
*
The new buffer's position will be zero, its limit will be its
* capacity, its mark will be undefined, and each of its elements will be
- * initialized to zero. It will have a {@link #array
- *
backing array}, and its {@link #arrayOffset array
- * offset} will be zero.
+ * initialized to zero. It will have a {@link #array backing array},
+ * and its {@link #arrayOffset array offset} will be zero.
*
* @param capacity
* The new buffer's capacity, in $type$s
@@ -344,8 +343,8 @@ public abstract class $Type$Buffer
* and vice versa. The new buffer's capacity will be
* array.length, its position will be offset, its limit
* will be offset + length, and its mark will be undefined. Its
- * {@link #array backing array} will be the given array, and
- * its {@link #arrayOffset array offset} will be zero.
+ * {@link #array backing array} will be the given array, and
+ * its {@link #arrayOffset array offset} will be zero.
*
* @param array
* The array that will back the new buffer
@@ -384,8 +383,8 @@ public abstract class $Type$Buffer
* that is, modifications to the buffer will cause the array to be modified
* and vice versa. The new buffer's capacity and limit will be
* array.length, its position will be zero, and its mark will be
- * undefined. Its {@link #array backing array} will be the
- * given array, and its {@link #arrayOffset array offset} will
+ * undefined. Its {@link #array backing array} will be the
+ * given array, and its {@link #arrayOffset array offset>} will
* be zero.
*
* @param array
@@ -703,6 +702,9 @@ public abstract class $Type$Buffer
*
* src.get(a, 0, a.length)
*
+ * @param dst
+ * The destination array
+ *
* @return This buffer
*
* @throws BufferUnderflowException
@@ -842,6 +844,9 @@ public abstract class $Type$Buffer
*
* dst.put(a, 0, a.length)
*
+ * @param src
+ * The source array
+ *
* @return This buffer
*
* @throws BufferOverflowException
@@ -930,6 +935,9 @@ public abstract class $Type$Buffer
*
* dst.put(s, 0, s.length())
*
+ * @param src
+ * The source string
+ *
* @return This buffer
*
* @throws BufferOverflowException
@@ -1419,7 +1427,7 @@ public abstract class $Type$Buffer
*
*
The byte order of $a$ $type$ buffer created by allocation or by
* wrapping an existing $type$ array is the {@link
- * ByteOrder#nativeOrder
The completion handler for an I/O operation initiated on a channel bound
* to a group is guaranteed to be invoked by one of the pooled threads in the
@@ -104,7 +104,7 @@ import java.util.concurrent.TimeUnit;
* handler directly by the initiating thread (see {@link
* AsynchronousServerSocketChannel#accept(Object,CompletionHandler) accept}).
*
- *
This file-locking API is intended to map directly to the native locking
* facility of the underlying operating system. Thus the locks held on a file
@@ -261,6 +261,11 @@ public abstract class FileLock implements AutoCloseable {
/**
* Tells whether or not this lock overlaps the given lock range.
*
+ * @param position
+ * The starting position of the lock range
+ * @param size
+ * The size of the lock range
+ *
* @return true if, and only if, this lock and the given lock
* range overlap by at least one byte
*/
diff --git a/src/share/classes/java/nio/channels/MulticastChannel.java b/src/share/classes/java/nio/channels/MulticastChannel.java
index 0e06633b51fd57729d4742638b7a2f7d5d10e143..ca17e2415ceffe25b98dbef7f99c392413c86f27 100644
--- a/src/share/classes/java/nio/channels/MulticastChannel.java
+++ b/src/share/classes/java/nio/channels/MulticastChannel.java
@@ -71,7 +71,7 @@ import java.net.StandardSocketOptions; // javadoc
* MembershipKey#drop drop} method drops membership so that datagrams from the
* source address can no longer be received.
*
- *
Platform dependencies
+ *
Platform dependencies
*
* The multicast implementation is intended to map directly to the native
* multicasting facility. Consequently, the following items should be considered
diff --git a/src/share/classes/java/nio/channels/NetworkChannel.java b/src/share/classes/java/nio/channels/NetworkChannel.java
index 3900f9d284b19eac10c4fe653ac9b97678eb443a..b56b5e25cce24e073d3da25ada374b337ca7295b 100644
--- a/src/share/classes/java/nio/channels/NetworkChannel.java
+++ b/src/share/classes/java/nio/channels/NetworkChannel.java
@@ -106,6 +106,8 @@ public interface NetworkChannel
/**
* Sets the value of a socket option.
*
+ * @param
+ * The type of the socket option value
* @param name
* The socket option
* @param value
@@ -130,6 +132,8 @@ public interface NetworkChannel
/**
* Returns the value of a socket option.
*
+ * @param
+ * The type of the socket option value
* @param name
* The socket option
*
diff --git a/src/share/classes/java/nio/channels/Pipe.java b/src/share/classes/java/nio/channels/Pipe.java
index af0722e99abd4affa434f959d7c0578de0d92c53..4b5a5a51ca71ee5fc21dd7ac7bf2846c613807f3 100644
--- a/src/share/classes/java/nio/channels/Pipe.java
+++ b/src/share/classes/java/nio/channels/Pipe.java
@@ -33,10 +33,9 @@ import java.nio.channels.spi.*;
* A pair of channels that implements a unidirectional pipe.
*
*
A pipe consists of a pair of channels: A writable {@link
- * Pipe.SinkChannel
sink} channel and a readable {@link
- * Pipe.SourceChannel source} channel. Once some bytes are
- * written to the sink channel they can be read from source channel in exactly
- * the order in which they were written.
+ * Pipe.SinkChannel sink} channel and a readable {@link Pipe.SourceChannel source}
+ * channel. Once some bytes are written to the sink channel they can be read
+ * from source channel in exactlyAthe order in which they were written.
*
*
Whether or not a thread writing bytes to a pipe will block until another
* thread reads those bytes, or some previously-written bytes, from the pipe is
@@ -63,6 +62,9 @@ public abstract class Pipe {
{
/**
* Constructs a new instance of this class.
+ *
+ * @param provider
+ * The selector provider
*/
protected SourceChannel(SelectorProvider provider) {
super(provider);
@@ -94,6 +96,9 @@ public abstract class Pipe {
{
/**
* Initializes a new instance of this class.
+ *
+ * @param provider
+ * The selector provider
*/
protected SinkChannel(SelectorProvider provider) {
super(provider);
diff --git a/src/share/classes/java/nio/channels/SelectableChannel.java b/src/share/classes/java/nio/channels/SelectableChannel.java
index 7041c34e188f196bb6fce2fcfa9369e5a662f1b1..17f86831d6dd42c8b7b8f902934ce8dee7bcb85f 100644
--- a/src/share/classes/java/nio/channels/SelectableChannel.java
+++ b/src/share/classes/java/nio/channels/SelectableChannel.java
@@ -64,8 +64,8 @@ import java.nio.channels.spi.SelectorProvider;
* threads.
*
* A selectable channel is either in blocking mode or in
* non-blocking mode. In blocking mode, every I/O operation invoked
@@ -142,6 +142,9 @@ public abstract class SelectableChannel
* Retrieves the key representing the channel's registration with the given
* selector.
*
+ * @param sel
+ * The selector
+ *
* @return The key returned when this channel was last registered with the
* given selector, or null if this channel is not
* currently registered with that selector
diff --git a/src/share/classes/java/nio/channels/SelectionKey.java b/src/share/classes/java/nio/channels/SelectionKey.java
index 7a0ab88ac3e1f41238254df5890fcc782db79915..e140ee61952d1fb31ce8449dc29f33232c3400b9 100644
--- a/src/share/classes/java/nio/channels/SelectionKey.java
+++ b/src/share/classes/java/nio/channels/SelectionKey.java
@@ -42,7 +42,7 @@ import java.io.IOException;
* next selection operation. The validity of a key may be tested by invoking
* its {@link #isValid isValid} method.
*
- *
+ *
*
*
A selection key contains two operation sets represented as
* integer values. Each bit of an operation set denotes a category of
diff --git a/src/share/classes/java/nio/channels/Selector.java b/src/share/classes/java/nio/channels/Selector.java
index d4c200e694283de36b779850b3e19151f84d4414..3f21727f220cc426423e5e99ba396f94f76ab254 100644
--- a/src/share/classes/java/nio/channels/Selector.java
+++ b/src/share/classes/java/nio/channels/Selector.java
@@ -36,13 +36,13 @@ import java.util.Set;
*
*
A selector may be created by invoking the {@link #open open} method of
* this class, which will use the system's default {@link
- * java.nio.channels.spi.SelectorProvider
selector provider} to
+ * java.nio.channels.spi.SelectorProvider selector provider} to
* create a new selector. A selector may also be created by invoking the
* {@link java.nio.channels.spi.SelectorProvider#openSelector openSelector}
* method of a custom selector provider. A selector remains open until it is
* closed via its {@link #close close} method.
*
- *
+ *
*
*
A selectable channel's registration with a selector is represented by a
* {@link SelectionKey} object. A selector maintains three sets of selection
@@ -80,18 +80,18 @@ import java.util.Set;
* during the next selection operation, at which time the key will removed from
* all of the selector's key sets.
*
- *
Keys are added to the selected-key set by selection
* operations. A key may be removed directly from the selected-key set by
* invoking the set's {@link java.util.Set#remove(java.lang.Object) remove}
* method or by invoking the {@link java.util.Iterator#remove() remove} method
- * of an {@link java.util.Iterator
iterator} obtained from the
+ * of an {@link java.util.Iterator iterator} obtained from the
* set. Keys are never removed from the selected-key set in any other way;
* they are not, in particular, removed as a side effect of selection
* operations. Keys may not be added directly to the selected-key set.
*
*
- *
- *
During each selection operation, keys may be added to and removed from a
* selector's selected-key set and may be removed from its key and
@@ -111,7 +111,7 @@ import java.util.Set;
* operation began. For a channel that is ready for at least one such
* operation, one of the following two actions is performed:
*
- *
+ *
*
*
If the channel's key is not already in the selected-key set then
* it is added to that set and its ready-operation set is modified to
@@ -126,7 +126,7 @@ import java.util.Set;
* words, the ready set returned by the underlying system is
* bitwise-disjoined into the key's current ready set.
*
- *
+ *
*
* If all of the keys in the key set at the start of this step have empty
* interest sets then neither the selected-key set nor any of the keys'
@@ -142,7 +142,7 @@ import java.util.Set;
* difference between the three selection methods.
*
*
- *
Concurrency
+ *
Concurrency
*
*
Selectors are themselves safe for use by multiple concurrent threads;
* their key sets, however, are not.
@@ -183,7 +183,7 @@ import java.util.Set;
*
The {@link #close close} method synchronizes on the selector and all
* three key sets in the same order as in a selection operation.
*
- *
+ *
*
*
A selector's key and selected-key sets are not, in general, safe for use
* by multiple concurrent threads. If such a thread might modify one of these
diff --git a/src/share/classes/java/nio/channels/ServerSocketChannel.java b/src/share/classes/java/nio/channels/ServerSocketChannel.java
index 90e39b529a4dece30e03f51d1ac4be8c2ffe6380..aeda90df0319e3ca0c53721c09a6078c6474aa57 100644
--- a/src/share/classes/java/nio/channels/ServerSocketChannel.java
+++ b/src/share/classes/java/nio/channels/ServerSocketChannel.java
@@ -46,7 +46,7 @@ import java.nio.channels.spi.SelectorProvider;
*
Socket options are configured using the {@link #setOption(SocketOption,Object)
* setOption} method. Server-socket channels support the following options:
*
- *
+ *
*
*
Option Name
*
Description
@@ -78,6 +78,9 @@ public abstract class ServerSocketChannel
/**
* Initializes a new instance of this class.
+ *
+ * @param provider
+ * The provider that created this channel
*/
protected ServerSocketChannel(SelectorProvider provider) {
super(provider);
diff --git a/src/share/classes/java/nio/channels/SocketChannel.java b/src/share/classes/java/nio/channels/SocketChannel.java
index 6203326490492f2f5db2516631e25c0638c1133e..091570cbf6424ab31464e1dd77a86d9ac56ebcf4 100644
--- a/src/share/classes/java/nio/channels/SocketChannel.java
+++ b/src/share/classes/java/nio/channels/SocketChannel.java
@@ -66,7 +66,7 @@ import java.nio.channels.spi.SelectorProvider;
*
Socket options are configured using the {@link #setOption(SocketOption,Object)
* setOption} method. Socket channels support the following options:
*
- *
+ *
*
*
Option Name
*
Description
@@ -120,6 +120,9 @@ public abstract class SocketChannel
/**
* Initializes a new instance of this class.
+ *
+ * @param provider
+ * The provider that created this channel
*/
protected SocketChannel(SelectorProvider provider) {
super(provider);
@@ -153,6 +156,8 @@ public abstract class SocketChannel
* @param remote
* The remote address to which the new channel is to be connected
*
+ * @return A new, and connected, socket channel
+ *
* @throws AsynchronousCloseException
* If another thread closes this channel
* while the connect operation is in progress
diff --git a/src/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java b/src/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java
index a5936832b7a3de05d84dd2865b05dba96c1e53ee..c8400692ee98bc3d628b813d7a57bc37d3b62313 100644
--- a/src/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java
+++ b/src/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java
@@ -46,7 +46,7 @@ import sun.nio.ch.Interruptible;
* before and after, respectively, invoking an I/O operation that might block
* indefinitely. In order to ensure that the {@link #end end} method is always
* invoked, these methods should be used within a
- * try ... finally block:
+ * try ... finally block:
*
*
The name of this class is taken from the terms used in
* RFC 2278.
@@ -737,6 +737,9 @@ public abstract class Charset
* it is not necessarily the case that the given charset is not contained
* in this charset.
*
+ * @param cs
+ * The given charset
+ *
* @return true if the given charset is contained in this charset
*/
public abstract boolean contains(Charset cs);
diff --git a/src/share/classes/java/nio/charset/CoderResult.java b/src/share/classes/java/nio/charset/CoderResult.java
index 5b2c4d41f89fc283f22a1398c6120c9f5fcbf1c2..15aad362c06c54a259f93b9cedae7e63c0c85337 100644
--- a/src/share/classes/java/nio/charset/CoderResult.java
+++ b/src/share/classes/java/nio/charset/CoderResult.java
@@ -227,6 +227,9 @@ public class CoderResult {
* Static factory method that returns the unique object describing a
* malformed-input error of the given length.
*
+ * @param length
+ * The given length
+ *
* @return The requested coder-result object
*/
public static CoderResult malformedForLength(int length) {
@@ -243,6 +246,9 @@ public class CoderResult {
* Static factory method that returns the unique result object describing
* an unmappable-character error of the given length.
*
+ * @param length
+ * The given length
+ *
* @return The requested coder-result object
*/
public static CoderResult unmappableForLength(int length) {
diff --git a/src/share/classes/java/nio/charset/spi/CharsetProvider.java b/src/share/classes/java/nio/charset/spi/CharsetProvider.java
index 3525e201d8757d485bc132b9ce46f148cf34ecd4..1e31d75fe310269e611f90ac8fa512eb70b7e314 100644
--- a/src/share/classes/java/nio/charset/spi/CharsetProvider.java
+++ b/src/share/classes/java/nio/charset/spi/CharsetProvider.java
@@ -39,8 +39,8 @@ import java.util.Iterator;
* the usual extension directories. Providers may also be made available by
* adding them to the applet or application class path or by some other
* platform-specific means. Charset providers are looked up via the current
- * thread's {@link java.lang.Thread#getContextClassLoader() context
- * class loader}.
+ * thread's {@link java.lang.Thread#getContextClassLoader() context class
+ * loader}.
*
*
A charset provider identifies itself with a provider-configuration file
* named java.nio.charset.spi.CharsetProvider in the resource
diff --git a/src/share/classes/java/nio/file/FileStore.java b/src/share/classes/java/nio/file/FileStore.java
index 831dba8a5e961d1002679e342e6a0fe6dd1f6c2b..d0bdc013992e7ee7d8d7de2e9483293dd76f4004 100644
--- a/src/share/classes/java/nio/file/FileStore.java
+++ b/src/share/classes/java/nio/file/FileStore.java
@@ -173,6 +173,8 @@ public abstract class FileStore {
* The {@code type} parameter is the type of the attribute view required and
* the method returns an instance of that type if supported.
*
+ * @param
+ * The {@code FileStoreAttributeView} type
* @param type
* the {@code Class} object corresponding to the attribute view
*
diff --git a/src/share/classes/java/nio/file/FileSystem.java b/src/share/classes/java/nio/file/FileSystem.java
index e2166079831cdaa3c549e8258134bc7db8bedcbc..2296cada82959cdffecfc6a705a162b31707bbb1 100644
--- a/src/share/classes/java/nio/file/FileSystem.java
+++ b/src/share/classes/java/nio/file/FileSystem.java
@@ -315,7 +315,7 @@ public abstract class FileSystem
* that resembles regular expressions but with a simpler syntax. For example:
*
*
- *
+ *
*
*
{@code *.java}
*
Matches a path that represents a file name ending in {@code .java}
diff --git a/src/share/classes/java/nio/file/FileSystems.java b/src/share/classes/java/nio/file/FileSystems.java
index ef443640af016a33b283cc0d5636ef9ce9e89fca..d6b4496dda7b8aac10c4451b970e4048d69c1592 100644
--- a/src/share/classes/java/nio/file/FileSystems.java
+++ b/src/share/classes/java/nio/file/FileSystems.java
@@ -200,6 +200,10 @@ public final class FileSystems {
* existing file system. In the case of the {@link FileSystems#getDefault
* default} file system, no permission check is required.
*
+ * @param uri the URI to locate the file system
+ *
+ * @return the reference to the file system
+ *
* @throws IllegalArgumentException
* if the pre-conditions for the {@code uri} parameter are not met
* @throws FileSystemNotFoundException
diff --git a/src/share/classes/java/nio/file/Files.java b/src/share/classes/java/nio/file/Files.java
index c4065690aa5e34c771d2859243be5f2ac8973762..ca0263d0660b2ff4a332ca073b55f5aacc8821e4 100644
--- a/src/share/classes/java/nio/file/Files.java
+++ b/src/share/classes/java/nio/file/Files.java
@@ -194,7 +194,7 @@ public final class Files {
*
In the addition to {@code READ} and {@code WRITE}, the following
* options may be present:
*
- *
Paths associated with the default {@link
* java.nio.file.spi.FileSystemProvider provider} are generally interoperable
* with the {@link java.io.File java.io.File} class. Paths created by other
@@ -87,7 +87,7 @@ import java.util.Iterator;
* addition, the {@link #toFile toFile} method is useful to construct a {@code
* File} from the {@code String} representation of a {@code Path}.
*
- *
Concurrency
+ *
Concurrency
*
Implementations of this interface are immutable and safe for use by
* multiple concurrent threads.
*
diff --git a/src/share/classes/java/nio/file/SecureDirectoryStream.java b/src/share/classes/java/nio/file/SecureDirectoryStream.java
index 6ef4882eae8a66d7fc5602bdef3b7dab5d8cde3a..2bfa2056b82c00f0168e805bbd1ff18492c19808 100644
--- a/src/share/classes/java/nio/file/SecureDirectoryStream.java
+++ b/src/share/classes/java/nio/file/SecureDirectoryStream.java
@@ -122,6 +122,8 @@ public interface SecureDirectoryStream
* an optional list of attributes to set atomically when creating
* the file
*
+ * @return the seekable byte channel
+ *
* @throws ClosedDirectoryStreamException
* if the directory stream is closed
* @throws IllegalArgumentException
@@ -260,6 +262,8 @@ public interface SecureDirectoryStream
* then all methods to read or update attributes will throw {@link
* ClosedDirectoryStreamException ClosedDirectoryStreamException}.
*
+ * @param
+ * The {@code FileAttributeView} type
* @param type
* the {@code Class} object corresponding to the file attribute view
*
@@ -288,6 +292,8 @@ public interface SecureDirectoryStream
* is created but methods to read or update attributes of the file will
* fail when invoked and the file does not exist.
*
+ * @param
+ * The {@code FileAttributeView} type
* @param path
* the path of the file
* @param type
diff --git a/src/share/classes/java/nio/file/WatchEvent.java b/src/share/classes/java/nio/file/WatchEvent.java
index cab199f0b572ead46b84d895dcafe9f1c789a4b8..508486851509008861de54c32b515648222c9758 100644
--- a/src/share/classes/java/nio/file/WatchEvent.java
+++ b/src/share/classes/java/nio/file/WatchEvent.java
@@ -55,11 +55,16 @@ public interface WatchEvent {
public static interface Kind {
/**
* Returns the name of the event kind.
+ *
+ * @return the name of the event kind
*/
String name();
/**
* Returns the type of the {@link WatchEvent#context context} value.
+ *
+ *
+ * @return the type of the context value
*/
Class type();
}
@@ -76,6 +81,8 @@ public interface WatchEvent {
public static interface Modifier {
/**
* Returns the name of the modifier.
+ *
+ * @return the name of the modifier
*/
String name();
}
diff --git a/src/share/classes/java/nio/file/WatchService.java b/src/share/classes/java/nio/file/WatchService.java
index 5a63fcd872227a5e127c3c45fde69f20c6d2aaff..c6440b208e474b960779b0a26424da0d0f8ccda6 100644
--- a/src/share/classes/java/nio/file/WatchService.java
+++ b/src/share/classes/java/nio/file/WatchService.java
@@ -78,7 +78,7 @@ import java.util.concurrent.TimeUnit;
* The {@link java.nio.channels.FileChannel FileChannel} class defines methods
* to lock regions of a file against access by other programs.
*
- *
Platform dependencies
+ *
Platform dependencies
*
*
The implementation that observes events from the file system is intended
* to map directly on to the native file event notification facility where
diff --git a/src/share/classes/java/nio/file/attribute/AclEntry.java b/src/share/classes/java/nio/file/attribute/AclEntry.java
index 9b4ef8a34c3cc4859b119d1e2d7d326360254085..49bf52924715ccc30112f1fcecf368837c6f0626 100644
--- a/src/share/classes/java/nio/file/attribute/AclEntry.java
+++ b/src/share/classes/java/nio/file/attribute/AclEntry.java
@@ -134,6 +134,7 @@ public final class AclEntry {
/**
* Sets the type component of this builder.
*
+ * @param type the component type
* @return this builder
*/
public Builder setType(AclEntryType type) {
@@ -146,6 +147,7 @@ public final class AclEntry {
/**
* Sets the principal component of this builder.
*
+ * @param who the principal component
* @return this builder
*/
public Builder setPrincipal(UserPrincipal who) {
@@ -168,6 +170,7 @@ public final class AclEntry {
* Sets the permissions component of this builder. On return, the
* permissions component of this builder is a copy of the given set.
*
+ * @param perms the permissions component
* @return this builder
*
* @throws ClassCastException
@@ -193,6 +196,7 @@ public final class AclEntry {
* permissions component of this builder is a copy of the permissions in
* the given array.
*
+ * @param perms the permissions component
* @return this builder
*/
public Builder setPermissions(AclEntryPermission... perms) {
@@ -211,6 +215,7 @@ public final class AclEntry {
* Sets the flags component of this builder. On return, the flags
* component of this builder is a copy of the given set.
*
+ * @param flags the flags component
* @return this builder
*
* @throws ClassCastException
@@ -236,6 +241,7 @@ public final class AclEntry {
* component of this builder is a copy of the flags in the given
* array.
*
+ * @param flags the flags component
* @return this builder
*/
public Builder setFlags(AclEntryFlag... flags) {
@@ -267,9 +273,7 @@ public final class AclEntry {
/**
* Constructs a new builder with the components of an existing ACL entry.
*
- * @param entry
- * an ACL entry
- *
+ * @param entry an ACL entry
* @return a new builder
*/
public static Builder newBuilder(AclEntry entry) {
@@ -278,6 +282,8 @@ public final class AclEntry {
/**
* Returns the ACL entry type.
+ *
+ * @return the ACL entry type
*/
public AclEntryType type() {
return type;
@@ -285,6 +291,8 @@ public final class AclEntry {
/**
* Returns the principal component.
+ *
+ * @return the principal component
*/
public UserPrincipal principal() {
return who;
@@ -294,6 +302,8 @@ public final class AclEntry {
* Returns a copy of the permissions component.
*
*
The returned set is a modifiable copy of the permissions.
+ *
+ * @return the permissions component
*/
public Set permissions() {
return new HashSet(perms);
@@ -303,6 +313,8 @@ public final class AclEntry {
* Returns a copy of the flags component.
*
*
The returned set is a modifiable copy of the flags.
+ *
+ * @return the flags component
*/
public Set flags() {
return new HashSet(flags);
diff --git a/src/share/classes/java/nio/file/attribute/AclFileAttributeView.java b/src/share/classes/java/nio/file/attribute/AclFileAttributeView.java
index 2f94937b6c114b9d0fbc55ccf8faee36683342cc..f5d58d41f4a964eba5794f6a3912aa542900c1cd 100644
--- a/src/share/classes/java/nio/file/attribute/AclFileAttributeView.java
+++ b/src/share/classes/java/nio/file/attribute/AclFileAttributeView.java
@@ -54,7 +54,7 @@ import java.io.IOException;
* supportsFileAttributeView} method can be used to test if a file system
* supports ACLs.
*
- *
*
* RFC 3530 allows for special user identities to be used on platforms that
* support the POSIX defined access permissions. The special user identities
@@ -65,7 +65,7 @@ import java.io.IOException;
* UserPrincipalLookupService} may be used to obtain a {@link UserPrincipal}
* to represent these special identities by invoking the {@link
* UserPrincipalLookupService#lookupPrincipalByName lookupPrincipalByName}
- * method.
+ * method.
*
*
Usage Example:
* Suppose we wish to add an entry to an existing ACL to grant "joe" access:
@@ -90,11 +90,11 @@ import java.io.IOException;
* view.setAcl(acl);
*
*
- *
Dynamic Access
+ *
Dynamic Access
*
Where dynamic access to file attributes is required, the attributes
* supported by this attribute view are as follows:
*
- *
+ *
*
*
Name
*
Type
@@ -118,7 +118,7 @@ import java.io.IOException;
* update the ACL or owner attributes as if by invoking the {@link #setAcl setAcl}
* or {@link #setOwner setOwner} methods.
*
- *
Setting the ACL when creating a file
+ *
Setting the ACL when creating a file
*
*
Implementations supporting this attribute view may also support setting
* the initial ACL when creating a file or directory. The initial ACL
diff --git a/src/share/classes/java/nio/file/attribute/AttributeView.java b/src/share/classes/java/nio/file/attribute/AttributeView.java
index 0b2951b960e270209cd384f0b51b4ba3eb9c8a36..d33f9764a79abaaab23deb06537a1f0a3c500354 100644
--- a/src/share/classes/java/nio/file/attribute/AttributeView.java
+++ b/src/share/classes/java/nio/file/attribute/AttributeView.java
@@ -38,6 +38,8 @@ package java.nio.file.attribute;
public interface AttributeView {
/**
* Returns the name of the attribute view.
+ *
+ * @return the name of the attribute view
*/
String name();
}
diff --git a/src/share/classes/java/nio/file/attribute/BasicFileAttributeView.java b/src/share/classes/java/nio/file/attribute/BasicFileAttributeView.java
index 2a8e2c9585bfaebbe6fb37c9a43a39be313c04e5..3a9c7916969802c41fc5040e9f70bd2a2a3d7fe6 100644
--- a/src/share/classes/java/nio/file/attribute/BasicFileAttributeView.java
+++ b/src/share/classes/java/nio/file/attribute/BasicFileAttributeView.java
@@ -41,7 +41,7 @@ import java.io.IOException;
*
Where dynamic access to file attributes is required, the attributes
* supported by this attribute view have the following names and types:
*
- *
+ *
*
*
Name
*
Type
diff --git a/src/share/classes/java/nio/file/attribute/BasicFileAttributes.java b/src/share/classes/java/nio/file/attribute/BasicFileAttributes.java
index d1f715dcea267014a5c572f320b8d9048c48df6b..df2d10bb27cd312d98d421363b5ebd6c2ae87f65 100644
--- a/src/share/classes/java/nio/file/attribute/BasicFileAttributes.java
+++ b/src/share/classes/java/nio/file/attribute/BasicFileAttributes.java
@@ -87,22 +87,31 @@ public interface BasicFileAttributes {
/**
* Tells whether the file is a regular file with opaque content.
+ *
+ * @return {@code true} if the file is a regular file with opaque content
*/
boolean isRegularFile();
/**
* Tells whether the file is a directory.
+ *
+ * @return {@code true} if the file is a directory
*/
boolean isDirectory();
/**
* Tells whether the file is a symbolic link.
+ *
+ * @return {@code true} if the file is a symbolic link
*/
boolean isSymbolicLink();
/**
* Tells whether the file is something other than a regular file, directory,
* or symbolic link.
+ *
+ * @return {@code true} if the file something other than a regular file,
+ * directory or symbolic link
*/
boolean isOther();
@@ -138,6 +147,8 @@ public interface BasicFileAttributes {
* and two files are the {@link java.nio.file.Files#isSameFile same} with
* non-{@code null} file keys, then their file keys are equal.
*
+ * @return an object that uniquely identifies the given file, or {@code null}
+ *
* @see java.nio.file.Files#walkFileTree
*/
Object fileKey();
diff --git a/src/share/classes/java/nio/file/attribute/DosFileAttributeView.java b/src/share/classes/java/nio/file/attribute/DosFileAttributeView.java
index aa99d23322ee67b47a86736d32c15a8ef30a60ef..1fb53853a618dc743d8a99eb70c7315a58fc1165 100644
--- a/src/share/classes/java/nio/file/attribute/DosFileAttributeView.java
+++ b/src/share/classes/java/nio/file/attribute/DosFileAttributeView.java
@@ -41,7 +41,7 @@ import java.io.IOException;
* BasicFileAttributeView}, and in addition, the following attributes are
* supported:
*
- *
+ *
*
*
Name
*
Type
diff --git a/src/share/classes/java/nio/file/attribute/FileAttribute.java b/src/share/classes/java/nio/file/attribute/FileAttribute.java
index d3704cbf8212217f6ec639e0efeb0ea2e2cb41cf..461687634872693da7b5864b11d7ea136cc23a11 100644
--- a/src/share/classes/java/nio/file/attribute/FileAttribute.java
+++ b/src/share/classes/java/nio/file/attribute/FileAttribute.java
@@ -40,11 +40,15 @@ package java.nio.file.attribute;
public interface FileAttribute {
/**
* Returns the attribute name.
+ *
+ * @return The attribute name
*/
String name();
/**
* Returns the attribute value.
+ *
+ * @return The attribute value
*/
T value();
}
diff --git a/src/share/classes/java/nio/file/attribute/PosixFileAttributeView.java b/src/share/classes/java/nio/file/attribute/PosixFileAttributeView.java
index ea5f1e2eaa64531ddb3df66eb2799827c1df0520..81a6a4156e7ffc8f118bd2e1fdac47614531e35e 100644
--- a/src/share/classes/java/nio/file/attribute/PosixFileAttributeView.java
+++ b/src/share/classes/java/nio/file/attribute/PosixFileAttributeView.java
@@ -68,13 +68,13 @@ import java.io.IOException;
* PosixFilePermissions.toString(attrs.permissions()));
*
*
- *
Dynamic Access
+ *
Dynamic Access
*
Where dynamic access to file attributes is required, the attributes
* supported by this attribute view are as defined by {@link
* BasicFileAttributeView} and {@link FileOwnerAttributeView}, and in addition,
* the following attributes are supported:
*
In case the client does not explicitly initialize the KeyPairGenerator
- * (via a call to an initialize method), each provider must
+ * (via a call to an {@code initialize} method), each provider must
* supply (and document) a default initialization.
* For example, the Sun provider uses a default modulus size (keysize)
* of 1024 bits.
*
*
Note that this class is abstract and extends from
- * KeyPairGeneratorSpi for historical reasons.
+ * {@code KeyPairGeneratorSpi} for historical reasons.
* Application developers should only take notice of the methods defined in
- * this KeyPairGenerator 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.
*
*
Every implementation of the Java platform is required to support the
- * following standard KeyPairGenerator algorithms and keysizes in
+ * following standard {@code KeyPairGenerator} algorithms and keysizes in
* parentheses:
*
Also, if there is a security manager, its
- * checkSecurityAccess method is called with the string
- * "putProviderProperty."+name, where name is
+ * {@code checkSecurityAccess} method is called with the string
+ * {@code "putProviderProperty."+name}, where {@code name} is
* the provider name, to see if it's ok to set this provider's property
- * values. If the default implementation of checkSecurityAccess
+ * values. If the default implementation of {@code checkSecurityAccess}
* is used (that is, that method is not overriden), then this results in
- * a call to the security manager's checkPermission method with
- * a SecurityPermission("putProviderProperty."+name)
+ * a call to the security manager's {@code checkPermission} method with
+ * a {@code SecurityPermission("putProviderProperty."+name)}
* permission.
*
* @param s the Service to add
*
* @throws SecurityException
- * if a security manager exists and its {@link
- * java.lang.SecurityManager#checkSecurityAccess} method denies
+ * if a security manager exists and its {@link
+ * java.lang.SecurityManager#checkSecurityAccess} method denies
* access to set property values.
* @throws NullPointerException if s is null
*
@@ -830,21 +831,21 @@ public abstract class Provider extends Properties {
* from this provider's Hashtable.
*
*
Also, if there is a security manager, its
- * checkSecurityAccess method is called with the string
- * "removeProviderProperty."+name, where name is
+ * {@code checkSecurityAccess} method is called with the string
+ * {@code "removeProviderProperty."+name}, where {@code name} is
* the provider name, to see if it's ok to remove this provider's
* properties. If the default implementation of
- * checkSecurityAccess is used (that is, that method is not
+ * {@code checkSecurityAccess} is used (that is, that method is not
* overriden), then this results in a call to the security manager's
- * checkPermission method with a
- * SecurityPermission("removeProviderProperty."+name)
+ * {@code checkPermission} method with a
+ * {@code SecurityPermission("removeProviderProperty."+name)}
* permission.
*
* @param s the Service to be removed
*
* @throws SecurityException
- * if a security manager exists and its {@link
- * java.lang.SecurityManager#checkSecurityAccess} method denies
+ * if a security manager exists and its {@link
+ * java.lang.SecurityManager#checkSecurityAccess} method denies
* access to remove this provider's properties.
* @throws NullPointerException if s is null
*
@@ -1122,7 +1123,7 @@ public abstract class Provider extends Properties {
}
/**
- * Get the type of this service. For example, MessageDigest.
+ * Get the type of this service. For example, {@code MessageDigest}.
*
* @return the type of this service
*/
@@ -1132,7 +1133,7 @@ public abstract class Provider extends Properties {
/**
* Return the name of the algorithm of this service. For example,
- * SHA-1.
+ * {@code SHA-1}.
*
* @return the algorithm of this service
*/
diff --git a/src/share/classes/java/security/ProviderException.java b/src/share/classes/java/security/ProviderException.java
index 449c8c361686528495dec678d4264194ab48b62c..b372ee7575272a3ab0285c1ed0acc72c366c0727 100644
--- a/src/share/classes/java/security/ProviderException.java
+++ b/src/share/classes/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 @@ public class ProviderException extends RuntimeException {
}
/**
- * Creates a ProviderException 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 null 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 @@ public class ProviderException extends RuntimeException {
}
/**
- * Creates a ProviderException with the specified cause
- * and a detail message of (cause==null ? null : cause.toString())
+ * 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
- * cause).
+ * {@code cause}).
*
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A null 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/src/share/classes/java/security/PublicKey.java b/src/share/classes/java/security/PublicKey.java
index c983ff611d985d36957ca8db75704b98bb826d8d..df49807eea4beb0986cf0bee73349931f2c03bc9 100644
--- a/src/share/classes/java/security/PublicKey.java
+++ b/src/share/classes/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 @@ package java.security;
*
* Note: The specialized public key interfaces extend this interface.
* See, for example, the DSAPublicKey interface in
- * java.security.interfaces.
+ * {@code java.security.interfaces}.
*
* @see Key
* @see PrivateKey
diff --git a/src/share/classes/java/security/SecureClassLoader.java b/src/share/classes/java/security/SecureClassLoader.java
index ffcd1a7160f195ae78ad897278564b33de737305..145f4fc482b5d9884369e67f5a4a6e419141a7b4 100644
--- a/src/share/classes/java/security/SecureClassLoader.java
+++ b/src/share/classes/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 @@ public class SecureClassLoader extends ClassLoader {
* class loader for delegation.
*
*
If there is a security manager, this method first
- * calls the security manager's checkCreateClassLoader
+ * calls the security manager's {@code checkCreateClassLoader}
* method to ensure creation of a class loader is allowed.
*
* @param parent the parent ClassLoader
* @exception SecurityException if a security manager exists and its
- * checkCreateClassLoader method doesn't allow
+ * {@code checkCreateClassLoader} method doesn't allow
* creation of a class loader.
* @see SecurityManager#checkCreateClassLoader
*/
@@ -87,11 +87,11 @@ public class SecureClassLoader extends ClassLoader {
* loader for delegation.
*
*
If there is a security manager, this method first
- * calls the security manager's checkCreateClassLoader
+ * 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
- * checkCreateClassLoader method doesn't allow
+ * {@code checkCreateClassLoader} method doesn't allow
* creation of a class loader.
* @see SecurityManager#checkCreateClassLoader
*/
@@ -113,22 +113,22 @@ public class SecureClassLoader extends ClassLoader {
* If a non-null CodeSource is supplied a ProtectionDomain is
* constructed and associated with the class being defined.
*
- * @param name the expected name of the class, or null
+ * @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 off through off+len-1
+ * positions {@code off} through {@code off+len-1}
* should have the format of a valid class file as defined by
* The Java™ Virtual Machine Specification.
- * @param off the start offset in b 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 null if none
- * @return the Class 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 off or
- * len is negative, or if
- * off+len is greater than b.length.
+ * @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 @@ public class SecureClassLoader extends ClassLoader {
}
/**
- * Converts a {@link java.nio.ByteBuffer ByteBuffer}
- * into an instance of class Class, 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.
*
* If a non-null CodeSource is supplied a ProtectionDomain is
* constructed and associated with the class being defined.
*
- * @param name the expected name of the class, or null
+ * @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
- * b.position() through b.position() + b.limit() -1
+ * {@code b.position()} through {@code b.position() + b.limit() -1}
* should have the format of a valid class file as defined by
* The Java™ Virtual Machine Specification.
- * @param cs the associated CodeSource, or null if none
- * @return the Class 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/src/share/classes/java/security/SecureRandom.java b/src/share/classes/java/security/SecureRandom.java
index 7d25b147ed316d132806e7d7b7a4f8bcd702bdde..5afec7b0797d854571d282bf83e5d15cd839c75f 100644
--- a/src/share/classes/java/security/SecureRandom.java
+++ b/src/share/classes/java/security/SecureRandom.java
@@ -50,7 +50,7 @@ import sun.security.jca.GetInstance.Instance;
* RFC 1750: Randomness Recommendations for Security
.
*
*
A caller obtains a SecureRandom instance via the
- * no-argument constructor or one of the getInstance methods:
+ * no-argument constructor or one of the {@code getInstance} methods:
*
*
* SecureRandom random = new SecureRandom();
@@ -71,15 +71,15 @@ import sun.security.jca.GetInstance.Instance;
* random.nextBytes(bytes);
*
*
- *
Callers may also invoke the generateSeed method
+ *
Callers may also invoke the {@code generateSeed} method
* to generate a given number of seed bytes (to seed other random number
* generators, for example):
*
* byte seed[] = random.generateSeed(20);
*
*
- * Note: Depending on the implementation, the generateSeed and
- * nextBytes methods may block as entropy is being gathered,
+ * Note: Depending on the implementation, the {@code generateSeed} and
+ * {@code nextBytes} methods may block as entropy is being gathered,
* for example, if they need to read from /dev/random on various Unix-like
* operating systems.
*
@@ -140,16 +140,16 @@ public class SecureRandom extends java.util.Random {
* for information about standard RNG algorithm names.
*
*
The returned SecureRandom object has not been seeded. To seed the
- * returned object, call the setSeed method.
- * If setSeed is not called, the first call to
- * nextBytes will force the SecureRandom object to seed itself.
- * This self-seeding will not occur if setSeed was
+ * returned object, call the {@code setSeed} method.
+ * If {@code setSeed} is not called, the first call to
+ * {@code nextBytes} will force the SecureRandom object to seed itself.
+ * This self-seeding will not occur if {@code setSeed} was
* previously called.
*/
public SecureRandom() {
/*
* This call to our superclass constructor will result in a call
- * to our own setSeed method, which will return
+ * to our own {@code setSeed} method, which will return
* immediately when it is passed zero.
*/
super(0);
@@ -250,10 +250,10 @@ public class SecureRandom extends java.util.Random {
* the {@link Security#getProviders() Security.getProviders()} method.
*
*
The returned SecureRandom object has not been seeded. To seed the
- * returned object, call the setSeed method.
- * If setSeed is not called, the first call to
- * nextBytes will force the SecureRandom object to seed itself.
- * This self-seeding will not occur if setSeed was
+ * returned object, call the {@code setSeed} method.
+ * If {@code setSeed} is not called, the first call to
+ * {@code nextBytes} will force the SecureRandom object to seed itself.
+ * This self-seeding will not occur if {@code setSeed} was
* previously called.
*
* @param algorithm the name of the RNG algorithm.
@@ -293,10 +293,10 @@ public class SecureRandom extends java.util.Random {
* the {@link Security#getProviders() Security.getProviders()} method.
*
*
The returned SecureRandom object has not been seeded. To seed the
- * returned object, call the setSeed method.
- * If setSeed is not called, the first call to
- * nextBytes will force the SecureRandom object to seed itself.
- * This self-seeding will not occur if setSeed was
+ * returned object, call the {@code setSeed} method.
+ * If {@code setSeed} is not called, the first call to
+ * {@code nextBytes} will force the SecureRandom object to seed itself.
+ * This self-seeding will not occur if {@code setSeed} was
* previously called.
*
* @param algorithm the name of the RNG algorithm.
@@ -341,10 +341,10 @@ public class SecureRandom extends java.util.Random {
* does not have to be registered in the provider list.
*
*
The returned SecureRandom object has not been seeded. To seed the
- * returned object, call the setSeed method.
- * If setSeed is not called, the first call to
- * nextBytes will force the SecureRandom object to seed itself.
- * This self-seeding will not occur if setSeed was
+ * returned object, call the {@code setSeed} method.
+ * If {@code setSeed} is not called, the first call to
+ * {@code nextBytes} will force the SecureRandom object to seed itself.
+ * This self-seeding will not occur if {@code setSeed} was
* previously called.
*
* @param algorithm the name of the RNG algorithm.
@@ -395,7 +395,7 @@ public class SecureRandom extends java.util.Random {
* Returns the name of the algorithm implemented by this SecureRandom
* object.
*
- * @return the name of the algorithm or unknown
+ * @return the name of the algorithm or {@code unknown}
* if the algorithm name cannot be determined.
* @since 1.5
*/
@@ -418,12 +418,12 @@ public class SecureRandom extends java.util.Random {
/**
* Reseeds this random object, using the eight bytes contained
- * in the given long seed. The given seed supplements,
+ * in the given {@code long seed}. The given seed supplements,
* rather than replaces, the existing seed. Thus, repeated calls
* are guaranteed never to reduce randomness.
*
*
This method is defined for compatibility with
- * java.util.Random.
+ * {@code java.util.Random}.
*
* @param seed the seed.
*
@@ -445,10 +445,10 @@ public class SecureRandom extends java.util.Random {
/**
* Generates a user-specified number of random bytes.
*
- *
If a call to setSeed had not occurred previously,
+ *
If a call to {@code setSeed} had not occurred previously,
* the first call to this method forces this SecureRandom object
* to seed itself. This self-seeding will not occur if
- * setSeed was previously called.
+ * {@code setSeed} was previously called.
*
* @param bytes the array to be filled in with random bytes.
*/
@@ -460,15 +460,15 @@ public class SecureRandom extends java.util.Random {
/**
* Generates an integer containing the user-specified number of
* pseudo-random bits (right justified, with leading zeros). This
- * method overrides a java.util.Random method, and serves
+ * method overrides a {@code java.util.Random} method, and serves
* to provide a source of random bits to all of the methods inherited
- * from that class (for example, nextInt,
- * nextLong, and nextFloat).
+ * from that class (for example, {@code nextInt},
+ * {@code nextLong}, and {@code nextFloat}).
*
* @param numBits number of pseudo-random bits to be generated, where
* {@code 0 <= numBits <= 32}.
*
- * @return an int containing the user-specified number
+ * @return an {@code int} containing the user-specified number
* of pseudo-random bits (right justified, with leading zeros).
*/
@Override
@@ -492,8 +492,8 @@ public class SecureRandom extends java.util.Random {
*
*
This method is only included for backwards compatibility.
* The caller is encouraged to use one of the alternative
- * getInstance methods to obtain a SecureRandom object, and
- * then call the generateSeed method to obtain seed bytes
+ * {@code getInstance} methods to obtain a SecureRandom object, and
+ * then call the {@code generateSeed} method to obtain seed bytes
* from that object.
*
* @param numBytes the number of seed bytes to generate.
diff --git a/src/share/classes/java/security/SecureRandomSpi.java b/src/share/classes/java/security/SecureRandomSpi.java
index 12652e98a65f7eee4c535174a072db884a25d782..ef6c243363087f9c4713a567a6f48fc3e9341f41 100644
--- a/src/share/classes/java/security/SecureRandomSpi.java
+++ b/src/share/classes/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 @@ package java.security;
/**
* This class defines the Service Provider Interface (SPI)
- * for the SecureRandom 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 @@ public abstract class SecureRandomSpi implements java.io.Serializable {
/**
* Generates a user-specified number of random bytes.
*
- *
If a call to engineSetSeed had not occurred previously,
+ *
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
- * engineSetSeed was previously called.
+ * {@code engineSetSeed} was previously called.
*
* @param bytes the array to be filled in with random bytes.
*/
diff --git a/src/share/classes/java/security/Security.java b/src/share/classes/java/security/Security.java
index eccede10b203c251e9591cbdb935f1523f486bd4..98699da8149c4e1e3eeadf91553c3071d51d875a 100644
--- a/src/share/classes/java/security/Security.java
+++ b/src/share/classes/java/security/Security.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2012, 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
@@ -298,7 +298,7 @@ public final class Security {
* 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
- * AlgorithmParameters and KeyFactory engine
+ * {@code AlgorithmParameters} and {@code KeyFactory} engine
* classes (introduced in the J2SE version 1.2 platform) instead.
*/
@Deprecated
@@ -321,21 +321,21 @@ public final class Security {
*
*
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 position, are shifted up
+ * with a position greater than {@code position}, are shifted up
* one position (towards the end of the list of installed providers).
*
*
A provider cannot be added if it is already installed.
*
*
First, if there is a security manager, its
- * checkSecurityAccess
+ * {@code checkSecurityAccess}
* method is called with the string
- * "insertProvider."+provider.getName()
+ * {@code "insertProvider."+provider.getName()}
* to see if it's ok to add a new provider.
- * If the default implementation of checkSecurityAccess
+ * 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 checkPermission method
+ * a call to the security manager's {@code checkPermission} method
* with a
- * SecurityPermission("insertProvider."+provider.getName())
+ * {@code SecurityPermission("insertProvider."+provider.getName())}
* permission.
*
* @param provider the provider to be added.
@@ -349,8 +349,8 @@ public final class Security {
*
* @throws NullPointerException if provider is null
* @throws SecurityException
- * if a security manager exists and its {@link
- * java.lang.SecurityManager#checkSecurityAccess} method
+ * if a security manager exists and its {@link
+ * java.lang.SecurityManager#checkSecurityAccess} method
* denies access to add a new provider
*
* @see #getProvider
@@ -374,15 +374,15 @@ public final class Security {
* Adds a provider to the next position available.
*
*
First, if there is a security manager, its
- * checkSecurityAccess
+ * {@code checkSecurityAccess}
* method is called with the string
- * "insertProvider."+provider.getName()
+ * {@code "insertProvider."+provider.getName()}
* to see if it's ok to add a new provider.
- * If the default implementation of checkSecurityAccess
+ * 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 checkPermission method
+ * a call to the security manager's {@code checkPermission} method
* with a
- * SecurityPermission("insertProvider."+provider.getName())
+ * {@code SecurityPermission("insertProvider."+provider.getName())}
* permission.
*
* @param provider the provider to be added.
@@ -393,8 +393,8 @@ public final class Security {
*
* @throws NullPointerException if provider is null
* @throws SecurityException
- * if a security manager exists and its {@link
- * java.lang.SecurityManager#checkSecurityAccess} method
+ * if a security manager exists and its {@link
+ * java.lang.SecurityManager#checkSecurityAccess} method
* denies access to add a new provider
*
* @see #getProvider
@@ -423,20 +423,20 @@ public final class Security {
* if name is null.
*
*
First, if there is a security manager, its
- * checkSecurityAccess
- * method is called with the string "removeProvider."+name
+ * {@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 checkSecurityAccess
+ * 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 checkPermission method
- * with a SecurityPermission("removeProvider."+name)
+ * 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 {@link
- * java.lang.SecurityManager#checkSecurityAccess} method
+ * if a security manager exists and its {@link
+ * java.lang.SecurityManager#checkSecurityAccess} method
* denies
* access to remove the provider
*
@@ -480,8 +480,8 @@ public final class Security {
* 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 preference order.
+ * according to their
+ * {@linkplain #insertProviderAt(java.security.Provider, int) preference order}.
*
*
A cryptographic service is always associated with a particular
* algorithm or type. For example, a digital signature service is
@@ -492,8 +492,8 @@ public final class Security {
*
The selection criterion must be specified in one of the following two
* formats:
*
- *
<crypto_service>.<algorithm_or_type>
The
- * cryptographic service name must not contain any dots.
+ *
{@literal .}
+ *
The cryptographic service name must not contain any dots.
*
A
* provider satisfies the specified selection criterion iff the provider
* implements the
@@ -501,11 +501,12 @@ public final class Security {
*
For example, "CertificateFactory.X.509"
* would be satisfied by any provider that supplied
* a CertificateFactory implementation for X.509 certificates.
- *
The cryptographic service name must not contain any dots. There
* must be one or more space charaters between the
- * <algorithm_or_type> and the <attribute_name>.
+ * {@literal } and the
+ * {@literal }.
*
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
@@ -558,8 +559,9 @@ public final class Security {
* 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 preference order.
+ * according to their
+ * {@linkplain #insertProviderAt(java.security.Provider, int)
+ * preference order}.
*
*
The selection criteria are represented by a map.
* Each map entry represents a selection criterion.
@@ -567,16 +569,18 @@ public final class Security {
* criteria. The key for any entry in such a map must be in one of the
* following two formats:
*
- *
<crypto_service>.<algorithm_or_type>
+ *
{@literal .}
*
The cryptographic service name must not contain any dots.
*
The value associated with the key must be an empty string.
*
A provider
* satisfies this selection criterion iff the provider implements the
* specified algorithm or type for the specified cryptographic service.
- *
The cryptographic service name must not contain any dots. There
- * must be one or more space charaters between the <algorithm_or_type>
- * and the <attribute_name>.
+ * must be one or more space charaters between the
+ * {@literal }
+ * and the {@literal }.
*
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
@@ -689,7 +693,7 @@ public final class Security {
* 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 provider 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)
@@ -720,7 +724,7 @@ public final class Security {
* 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 provider argument cannot be null.
+ * The {@code provider} argument cannot be null.
*/
static Object[] getImpl(String algorithm, String type, Provider provider)
throws NoSuchAlgorithmException {
@@ -739,8 +743,8 @@ public final class Security {
* Gets a security property value.
*
*
First, if there is a security manager, its
- * checkPermission method is called with a
- * java.security.SecurityPermission("getProperty."+key)
+ * {@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..
*
@@ -749,8 +753,8 @@ public final class Security {
* @return the value of the security property corresponding to key.
*
* @throws SecurityException
- * if a security manager exists and its {@link
- * java.lang.SecurityManager#checkPermission} 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
@@ -774,8 +778,8 @@ public final class Security {
* Sets a security property value.
*
*
First, if there is a security manager, its
- * checkPermission method is called with a
- * java.security.SecurityPermission("setProperty."+key)
+ * {@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.
*
@@ -784,8 +788,8 @@ public final class Security {
* @param datum the value of the property to be set.
*
* @throws SecurityException
- * if a security manager exists and its {@link
- * java.lang.SecurityManager#checkPermission} 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
*
diff --git a/src/share/classes/java/security/SecurityPermission.java b/src/share/classes/java/security/SecurityPermission.java
index 69eaf7357338dd0440aba5cf15ce3b9eef0d3350..e0f0f92b40c49d7f7222ccdc4aafd4bf4cd2054a 100644
--- a/src/share/classes/java/security/SecurityPermission.java
+++ b/src/share/classes/java/security/SecurityPermission.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
@@ -57,7 +57,7 @@ import java.util.StringTokenizer;
*
createAccessControlContext
*
Creation of an AccessControlContext
*
This allows someone to instantiate an AccessControlContext
- * with a DomainCombiner. Extreme care must be taken when
+ * with a {@code DomainCombiner}. Extreme care must be taken when
* granting this permission. Malicious code could create a DomainCombiner
* that augments the set of permissions granted to code, and even grant the
* code {@link java.security.AllPermission}.
Retrieval of an AccessControlContext's DomainCombiner
*
This allows someone to retrieve an AccessControlContext's
- * DomainCombiner. Since DomainCombiners may contain
+ * {@code DomainCombiner}. Since DomainCombiners may contain
* sensitive information, this could potentially lead to a privacy leak.
Retrieval of the system-wide security policy (specifically, of the
* currently-installed Policy object)
*
This allows someone to query the policy via the
- * getPermissions call,
+ * {@code getPermissions} call,
* which discloses which permissions would be granted to a given CodeSource.
* While revealing the policy does not compromise the security of
* the system, it does provide malicious code with additional information
@@ -303,8 +303,8 @@ public final class SecurityPermission extends BasicPermission {
*
* @param name the name of the SecurityPermission
*
- * @throws NullPointerException if name is null.
- * @throws IllegalArgumentException if name is empty.
+ * @throws NullPointerException if {@code name} is {@code null}.
+ * @throws IllegalArgumentException if {@code name} is empty.
*/
public SecurityPermission(String name)
@@ -320,8 +320,8 @@ public final class SecurityPermission extends BasicPermission {
* @param name the name of the SecurityPermission
* @param actions should be null.
*
- * @throws NullPointerException if name is null.
- * @throws IllegalArgumentException if name is empty.
+ * @throws NullPointerException if {@code name} is {@code null}.
+ * @throws IllegalArgumentException if {@code name} is empty.
*/
public SecurityPermission(String name, String actions)
diff --git a/src/share/classes/java/security/Signature.java b/src/share/classes/java/security/Signature.java
index 2d014d21efe863362458616eeb060d669e127e37..a40290f8c99abd0339613ffa23609901a4718f59 100644
--- a/src/share/classes/java/security/Signature.java
+++ b/src/share/classes/java/security/Signature.java
@@ -53,10 +53,10 @@ import sun.security.jca.GetInstance.Instance;
*
*
The signature algorithm can be, among others, the NIST standard
* DSA, using DSA and SHA-1. The DSA algorithm using the
- * SHA-1 message digest algorithm can be specified as SHA1withDSA.
+ * SHA-1 message digest algorithm can be specified as {@code SHA1withDSA}.
* In the case of RSA, there are multiple choices for the message digest
* algorithm, so the signing algorithm could be specified as, for example,
- * MD2withRSA, MD5withRSA, or SHA1withRSA.
+ * {@code MD2withRSA}, {@code MD5withRSA}, or {@code SHA1withRSA}.
* The algorithm name must be specified, as there is no default.
*
*
A Signature object can be used to generate and verify digital
@@ -92,18 +92,18 @@ import sun.security.jca.GetInstance.Instance;
*
*
*
Note that this class is abstract and extends from
- * SignatureSpi for historical reasons.
+ * {@code SignatureSpi} for historical reasons.
* Application developers should only take notice of the methods defined in
- * this Signature class; all the methods in
+ * this {@code Signature} class; all the methods in
* the superclass are intended for cryptographic service providers who wish to
* supply their own implementations of digital signature algorithms.
*
*
Every implementation of the Java platform is required to support the
- * following standard Signature algorithms:
+ * following standard {@code Signature} algorithms:
*
A new CertPathBuilder object encapsulating the
@@ -177,7 +177,7 @@ public class CertPathBuilder {
*
Note that the list of registered providers may be retrieved via
* the {@link Security#getProviders() Security.getProviders()} method.
*
- * @param algorithm the name of the requested CertPathBuilder
+ * @param algorithm the name of the requested {@code CertPathBuilder}
* algorithm. See the CertPathBuilder section in the
* Java Cryptography Architecture Standard Algorithm Name Documentation
@@ -185,7 +185,7 @@ public class CertPathBuilder {
*
* @param provider the name of the provider.
*
- * @return a CertPathBuilder object that implements the
+ * @return a {@code CertPathBuilder} object that implements the
* specified algorithm.
*
* @throws NoSuchAlgorithmException if a CertPathBuilderSpi
@@ -195,7 +195,7 @@ public class CertPathBuilder {
* @throws NoSuchProviderException if the specified provider is not
* registered in the security provider list.
*
- * @exception IllegalArgumentException if the provider is
+ * @exception IllegalArgumentException if the {@code provider} is
* null or empty.
*
* @see java.security.Provider
@@ -209,7 +209,7 @@ public class CertPathBuilder {
}
/**
- * Returns a CertPathBuilder object that implements the
+ * Returns a {@code CertPathBuilder} object that implements the
* specified algorithm.
*
*
A new CertPathBuilder object encapsulating the
@@ -217,7 +217,7 @@ public class CertPathBuilder {
* object is returned. Note that the specified Provider object
* does not have to be registered in the provider list.
*
- * @param algorithm the name of the requested CertPathBuilder
+ * @param algorithm the name of the requested {@code CertPathBuilder}
* algorithm. See the CertPathBuilder section in the
* Java Cryptography Architecture Standard Algorithm Name Documentation
@@ -225,14 +225,14 @@ public class CertPathBuilder {
*
* @param provider the provider.
*
- * @return a CertPathBuilder object that implements the
+ * @return a {@code CertPathBuilder} object that implements the
* specified algorithm.
*
* @exception NoSuchAlgorithmException if a CertPathBuilderSpi
* implementation for the specified algorithm is not available
* from the specified Provider object.
*
- * @exception IllegalArgumentException if the provider is
+ * @exception IllegalArgumentException if the {@code provider} is
* null.
*
* @see java.security.Provider
@@ -246,18 +246,18 @@ public class CertPathBuilder {
}
/**
- * Returns the provider of this CertPathBuilder.
+ * Returns the provider of this {@code CertPathBuilder}.
*
- * @return the provider of this CertPathBuilder
+ * @return the provider of this {@code CertPathBuilder}
*/
public final Provider getProvider() {
return this.provider;
}
/**
- * Returns the name of the algorithm of this CertPathBuilder.
+ * Returns the name of the algorithm of this {@code CertPathBuilder}.
*
- * @return the name of the algorithm of this CertPathBuilder
+ * @return the name of the algorithm of this {@code CertPathBuilder}
*/
public final String getAlgorithm() {
return this.algorithm;
@@ -272,7 +272,7 @@ public class CertPathBuilder {
* @throws CertPathBuilderException if the builder is unable to construct
* a certification path that satisfies the specified parameters
* @throws InvalidAlgorithmParameterException if the specified parameters
- * are inappropriate for this CertPathBuilder
+ * are inappropriate for this {@code CertPathBuilder}
*/
public final CertPathBuilderResult build(CertPathParameters params)
throws CertPathBuilderException, InvalidAlgorithmParameterException
diff --git a/src/share/classes/java/security/cert/CertPathBuilderException.java b/src/share/classes/java/security/cert/CertPathBuilderException.java
index 4d460c66db9a955ba41ab944ce0ea972fe7e865f..cf95847922b4d86370ef8af321c2f8051644e8de 100644
--- a/src/share/classes/java/security/cert/CertPathBuilderException.java
+++ b/src/share/classes/java/security/cert/CertPathBuilderException.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 @@ import java.security.GeneralSecurityException;
/**
* An exception indicating one of a variety of problems encountered when
- * building a certification path with a CertPathBuilder.
+ * building a certification path with a {@code CertPathBuilder}.
*
- * A CertPathBuilderException provides support for wrapping
+ * A {@code CertPathBuilderException} provides support for wrapping
* exceptions. The {@link #getCause getCause} method returns the throwable,
* if any, that caused this exception to be thrown.
*
@@ -53,7 +53,7 @@ public class CertPathBuilderException extends GeneralSecurityException {
private static final long serialVersionUID = 5316471420178794402L;
/**
- * Creates a CertPathBuilderException with null
+ * Creates a {@code CertPathBuilderException} with {@code null}
* as its detail message.
*/
public CertPathBuilderException() {
@@ -61,8 +61,8 @@ public class CertPathBuilderException extends GeneralSecurityException {
}
/**
- * Creates a CertPathBuilderException with the given
- * detail message. The detail message is a String that
+ * Creates a {@code CertPathBuilderException} with the given
+ * detail message. The detail message is a {@code String} that
* describes this particular exception in more detail.
*
* @param msg the detail message
@@ -72,16 +72,16 @@ public class CertPathBuilderException extends GeneralSecurityException {
}
/**
- * Creates a CertPathBuilderException that wraps the specified
+ * Creates a {@code CertPathBuilderException} that wraps the specified
* throwable. This allows any exception to be converted into a
- * CertPathBuilderException, while retaining information
+ * {@code CertPathBuilderException}, while retaining information
* about the wrapped exception, which may be useful for debugging. The
- * detail message is set to (cause==null ? null : cause.toString()
- * ) (which typically contains the class and detail message of
+ * detail message is 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 null value is
+ * {@link #getCause getCause()} method). (A {@code null} value is
* permitted, and indicates that the cause is nonexistent or unknown.)
*/
public CertPathBuilderException(Throwable cause) {
@@ -89,12 +89,12 @@ public class CertPathBuilderException extends GeneralSecurityException {
}
/**
- * Creates a CertPathBuilderException with the specified
+ * Creates a {@code CertPathBuilderException} 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 null value is
+ * {@link #getCause getCause()} method). (A {@code null} value is
* permitted, and indicates that the cause is nonexistent or unknown.)
*/
public CertPathBuilderException(String msg, Throwable cause) {
diff --git a/src/share/classes/java/security/cert/CertPathBuilderResult.java b/src/share/classes/java/security/cert/CertPathBuilderResult.java
index 71eed201ac4b01273193327f42f3dc0d455e7264..ecf53bbe750bcb4caab23e6ecf806efa6fc30013 100644
--- a/src/share/classes/java/security/cert/CertPathBuilderResult.java
+++ b/src/share/classes/java/security/cert/CertPathBuilderResult.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
@@ -30,8 +30,8 @@ package java.security.cert;
* All results returned by the {@link CertPathBuilder#build
* CertPathBuilder.build} method must implement this interface.
*
- * At a minimum, a CertPathBuilderResult contains the
- * CertPath built by the CertPathBuilder instance.
+ * At a minimum, a {@code CertPathBuilderResult} contains the
+ * {@code CertPath} built by the {@code CertPathBuilder} instance.
* Implementations of this interface may add methods to return implementation
* or algorithm specific information, such as debugging information or
* certification path validation results.
@@ -54,15 +54,15 @@ public interface CertPathBuilderResult extends Cloneable {
/**
* Returns the built certification path.
*
- * @return the certification path (never null)
+ * @return the certification path (never {@code null})
*/
CertPath getCertPath();
/**
- * Makes a copy of this CertPathBuilderResult. Changes to the
+ * Makes a copy of this {@code CertPathBuilderResult}. Changes to the
* copy will not affect the original and vice versa.
*
- * @return a copy of this CertPathBuilderResult
+ * @return a copy of this {@code CertPathBuilderResult}
*/
Object clone();
}
diff --git a/src/share/classes/java/security/cert/CertPathBuilderSpi.java b/src/share/classes/java/security/cert/CertPathBuilderSpi.java
index 49a35b36e906ae67548bd0fd08c94aede73f16dc..87908c03bd9f239f343a19ff4fb116d44dcfd92f 100644
--- a/src/share/classes/java/security/cert/CertPathBuilderSpi.java
+++ b/src/share/classes/java/security/cert/CertPathBuilderSpi.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2012, 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,23 +30,23 @@ import java.security.InvalidAlgorithmParameterException;
/**
* The Service Provider Interface (SPI)
* for the {@link CertPathBuilder CertPathBuilder} class. All
- * CertPathBuilder implementations must include a class (the
- * SPI class) that extends this class (CertPathBuilderSpi) and
+ * {@code CertPathBuilder} implementations must include a class (the
+ * SPI class) that extends this class ({@code CertPathBuilderSpi}) and
* implements all of its methods. In general, instances of this class should
- * only be accessed through the CertPathBuilder class. For
+ * only be accessed through the {@code CertPathBuilder} class. For
* details, see the Java Cryptography Architecture.
*
* Concurrent Access
*
* Instances of this class need not be protected against concurrent
* access from multiple threads. Threads that need to access a single
- * CertPathBuilderSpi instance concurrently should synchronize
+ * {@code CertPathBuilderSpi} instance concurrently should synchronize
* amongst themselves and provide the necessary locking before calling the
- * wrapping CertPathBuilder object.
+ * wrapping {@code CertPathBuilder} object.
*
- * However, implementations of CertPathBuilderSpi may still
+ * However, implementations of {@code CertPathBuilderSpi} may still
* encounter concurrency issues, since multiple threads each
- * manipulating a different CertPathBuilderSpi instance need not
+ * manipulating a different {@code CertPathBuilderSpi} instance need not
* synchronize.
*
* @since 1.4
@@ -68,7 +68,7 @@ public abstract class CertPathBuilderSpi {
* @throws CertPathBuilderException if the builder is unable to construct
* a certification path that satisfies the specified parameters
* @throws InvalidAlgorithmParameterException if the specified parameters
- * are inappropriate for this CertPathBuilder
+ * are inappropriate for this {@code CertPathBuilder}
*/
public abstract CertPathBuilderResult engineBuild(CertPathParameters params)
throws CertPathBuilderException, InvalidAlgorithmParameterException;
diff --git a/src/share/classes/java/security/cert/CertPathParameters.java b/src/share/classes/java/security/cert/CertPathParameters.java
index 46f9d8841bc3f4268481d94f1fad3550b94e8266..ace1b21f63f6182d2b4932ab92c6d1a9080818ca 100644
--- a/src/share/classes/java/security/cert/CertPathParameters.java
+++ b/src/share/classes/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 @@ package java.security.cert;
/**
* A specification of certification path algorithm parameters.
* The purpose of this interface is to group (and provide type safety for)
- * all CertPath parameter specifications. All
- * CertPath 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 @@ package java.security.cert;
public interface CertPathParameters extends Cloneable {
/**
- * Makes a copy of this CertPathParameters. 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 CertPathParameters
+ * @return a copy of this {@code CertPathParameters}
*/
Object clone();
}
diff --git a/src/share/classes/java/security/cert/CertPathValidator.java b/src/share/classes/java/security/cert/CertPathValidator.java
index 99ecb1e1603903862b5ccd239a7523c0c0cf694f..bd2ff56dd0cd5e93fb7cfd73b1e617e550313218 100644
--- a/src/share/classes/java/security/cert/CertPathValidator.java
+++ b/src/share/classes/java/security/cert/CertPathValidator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2012, 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
@@ -42,17 +42,17 @@ import sun.security.jca.GetInstance.Instance;
* chains).
*
* This class uses a provider-based architecture.
- * To create a CertPathValidator,
- * call one of the static getInstance methods, passing in the
- * algorithm name of the CertPathValidator desired and
+ * To create a {@code CertPathValidator},
+ * call one of the static {@code getInstance} methods, passing in the
+ * algorithm name of the {@code CertPathValidator} desired and
* optionally the name of the provider desired.
*
- *
Once a CertPathValidator object has been created, it can
+ *
Once a {@code CertPathValidator} object has been created, it can
* be used to validate certification paths by calling the {@link #validate
- * validate} method and passing it the CertPath to be validated
+ * validate} method and passing it the {@code CertPath} to be validated
* and an algorithm-specific set of parameters. If successful, the result is
* returned in an object that implements the
- * CertPathValidatorResult interface.
+ * {@code CertPathValidatorResult} interface.
*
*
The {@link #getRevocationChecker} method allows an application to specify
* additional algorithm-specific parameters and options used by the
@@ -69,9 +69,9 @@ import sun.security.jca.GetInstance.Instance;
*
*
*
Every implementation of the Java platform is required to support the
- * following standard CertPathValidator algorithm:
+ * following standard {@code CertPathValidator} algorithm:
*
A new CertPathValidator object encapsulating the
@@ -178,7 +178,7 @@ public class CertPathValidator {
*
Note that the list of registered providers may be retrieved via
* the {@link Security#getProviders() Security.getProviders()} method.
*
- * @param algorithm the name of the requested CertPathValidator
+ * @param algorithm the name of the requested {@code CertPathValidator}
* algorithm. See the CertPathValidator section in the
* Java Cryptography Architecture Standard Algorithm Name Documentation
@@ -186,7 +186,7 @@ public class CertPathValidator {
*
* @param provider the name of the provider.
*
- * @return a CertPathValidator object that implements the
+ * @return a {@code CertPathValidator} object that implements the
* specified algorithm.
*
* @exception NoSuchAlgorithmException if a CertPathValidatorSpi
@@ -196,7 +196,7 @@ public class CertPathValidator {
* @exception NoSuchProviderException if the specified provider is not
* registered in the security provider list.
*
- * @exception IllegalArgumentException if the provider is
+ * @exception IllegalArgumentException if the {@code provider} is
* null or empty.
*
* @see java.security.Provider
@@ -211,7 +211,7 @@ public class CertPathValidator {
}
/**
- * Returns a CertPathValidator object that implements the
+ * Returns a {@code CertPathValidator} object that implements the
* specified algorithm.
*
*
A new CertPathValidator object encapsulating the
@@ -219,7 +219,7 @@ public class CertPathValidator {
* object is returned. Note that the specified Provider object
* does not have to be registered in the provider list.
*
- * @param algorithm the name of the requested CertPathValidator
+ * @param algorithm the name of the requested {@code CertPathValidator}
* algorithm. See the CertPathValidator section in the
* Java Cryptography Architecture Standard Algorithm Name Documentation
@@ -227,14 +227,14 @@ public class CertPathValidator {
*
* @param provider the provider.
*
- * @return a CertPathValidator object that implements the
+ * @return a {@code CertPathValidator} object that implements the
* specified algorithm.
*
* @exception NoSuchAlgorithmException if a CertPathValidatorSpi
* implementation for the specified algorithm is not available
* from the specified Provider object.
*
- * @exception IllegalArgumentException if the provider is
+ * @exception IllegalArgumentException if the {@code provider} is
* null.
*
* @see java.security.Provider
@@ -248,19 +248,19 @@ public class CertPathValidator {
}
/**
- * Returns the Provider of this
- * CertPathValidator.
+ * Returns the {@code Provider} of this
+ * {@code CertPathValidator}.
*
- * @return the Provider of this CertPathValidator
+ * @return the {@code Provider} of this {@code CertPathValidator}
*/
public final Provider getProvider() {
return this.provider;
}
/**
- * Returns the algorithm name of this CertPathValidator.
+ * Returns the algorithm name of this {@code CertPathValidator}.
*
- * @return the algorithm name of this CertPathValidator
+ * @return the algorithm name of this {@code CertPathValidator}
*/
public final String getAlgorithm() {
return this.algorithm;
@@ -270,20 +270,20 @@ public class CertPathValidator {
* Validates the specified certification path using the specified
* algorithm parameter set.
*
- * The CertPath specified must be of a type that is
+ * The {@code CertPath} specified must be of a type that is
* supported by the validation algorithm, otherwise an
- * InvalidAlgorithmParameterException will be thrown. For
- * example, a CertPathValidator that implements the PKIX
- * algorithm validates CertPath objects of type X.509.
+ * {@code InvalidAlgorithmParameterException} will be thrown. For
+ * example, a {@code CertPathValidator} that implements the PKIX
+ * algorithm validates {@code CertPath} objects of type X.509.
*
- * @param certPath the CertPath to be validated
+ * @param certPath the {@code CertPath} to be validated
* @param params the algorithm parameters
* @return the result of the validation algorithm
- * @exception CertPathValidatorException if the CertPath
+ * @exception CertPathValidatorException if the {@code CertPath}
* does not validate
* @exception InvalidAlgorithmParameterException if the specified
- * parameters or the type of the specified CertPath are
- * inappropriate for this CertPathValidator
+ * parameters or the type of the specified {@code CertPath} are
+ * inappropriate for this {@code CertPathValidator}
*/
public final CertPathValidatorResult validate(CertPath certPath,
CertPathParameters params)
diff --git a/src/share/classes/java/security/cert/CertPathValidatorException.java b/src/share/classes/java/security/cert/CertPathValidatorException.java
index 03cae751a0fecdbbe26c2b3874e17000246a875f..7e6b9165faecb3e394bcd669ffcab959907b0734 100644
--- a/src/share/classes/java/security/cert/CertPathValidatorException.java
+++ b/src/share/classes/java/security/cert/CertPathValidatorException.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
@@ -34,11 +34,11 @@ import java.security.GeneralSecurityException;
* An exception indicating one of a variety of problems encountered when
* validating a certification path.
*
- * A CertPathValidatorException provides support for wrapping
+ * A {@code CertPathValidatorException} provides support for wrapping
* exceptions. The {@link #getCause getCause} method returns the throwable,
* if any, that caused this exception to be thrown.
*
- * A CertPathValidatorException may also include the
+ * A {@code CertPathValidatorException} may also include the
* certification path that was being validated when the exception was thrown,
* the index of the certificate in the certification path that caused the
* exception to be thrown, and the reason that caused the failure. Use the
@@ -70,7 +70,7 @@ public class CertPathValidatorException extends GeneralSecurityException {
private int index = -1;
/**
- * @serial the CertPath that was being validated when
+ * @serial the {@code CertPath} that was being validated when
* the exception was thrown
*/
private CertPath certPath;
@@ -81,7 +81,7 @@ public class CertPathValidatorException extends GeneralSecurityException {
private Reason reason = BasicReason.UNSPECIFIED;
/**
- * Creates a CertPathValidatorException with
+ * Creates a {@code CertPathValidatorException} with
* no detail message.
*/
public CertPathValidatorException() {
@@ -89,8 +89,8 @@ public class CertPathValidatorException extends GeneralSecurityException {
}
/**
- * Creates a CertPathValidatorException with the given
- * detail message. A detail message is a String that
+ * Creates a {@code CertPathValidatorException} with the given
+ * detail message. A detail message is a {@code String} that
* describes this particular exception.
*
* @param msg the detail message
@@ -100,16 +100,16 @@ public class CertPathValidatorException extends GeneralSecurityException {
}
/**
- * Creates a CertPathValidatorException that wraps the
+ * Creates a {@code CertPathValidatorException} that wraps the
* specified throwable. This allows any exception to be converted into a
- * CertPathValidatorException, while retaining information
+ * {@code CertPathValidatorException}, while retaining information
* about the wrapped exception, which may be useful for debugging. The
- * detail message is set to (cause==null ? null : cause.toString()
- * ) (which typically contains the class and detail message of
+ * detail message is 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 null value is
+ * {@link #getCause getCause()} method). (A {@code null} value is
* permitted, and indicates that the cause is nonexistent or unknown.)
*/
public CertPathValidatorException(Throwable cause) {
@@ -117,12 +117,12 @@ public class CertPathValidatorException extends GeneralSecurityException {
}
/**
- * Creates a CertPathValidatorException with the specified
+ * Creates a {@code CertPathValidatorException} 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 null value is
+ * {@link #getCause getCause()} method). (A {@code null} value is
* permitted, and indicates that the cause is nonexistent or unknown.)
*/
public CertPathValidatorException(String msg, Throwable cause) {
@@ -130,21 +130,21 @@ public class CertPathValidatorException extends GeneralSecurityException {
}
/**
- * Creates a CertPathValidatorException with the specified
+ * Creates a {@code CertPathValidatorException} with the specified
* detail message, cause, certification path, and index.
*
- * @param msg the detail message (or null if none)
- * @param cause the cause (or null if none)
+ * @param msg the detail message (or {@code null} if none)
+ * @param cause the cause (or {@code null} if none)
* @param certPath the certification path that was in the process of
* being validated when the error was encountered
* @param index the index of the certificate in the certification path
* that caused the error (or -1 if not applicable). Note that
- * the list of certificates in a CertPath is zero based.
+ * the list of certificates in a {@code CertPath} is zero based.
* @throws IndexOutOfBoundsException if the index is out of range
* {@code (index < -1 || (certPath != null && index >=
* certPath.getCertificates().size()) }
- * @throws IllegalArgumentException if certPath is
- * null and index is not -1
+ * @throws IllegalArgumentException if {@code certPath} is
+ * {@code null} and {@code index} is not -1
*/
public CertPathValidatorException(String msg, Throwable cause,
CertPath certPath, int index) {
@@ -152,23 +152,23 @@ public class CertPathValidatorException extends GeneralSecurityException {
}
/**
- * Creates a CertPathValidatorException with the specified
+ * Creates a {@code CertPathValidatorException} with the specified
* detail message, cause, certification path, index, and reason.
*
- * @param msg the detail message (or null if none)
- * @param cause the cause (or null if none)
+ * @param msg the detail message (or {@code null} if none)
+ * @param cause the cause (or {@code null} if none)
* @param certPath the certification path that was in the process of
* being validated when the error was encountered
* @param index the index of the certificate in the certification path
* that caused the error (or -1 if not applicable). Note that
- * the list of certificates in a CertPath is zero based.
+ * the list of certificates in a {@code CertPath} is zero based.
* @param reason the reason the validation failed
* @throws IndexOutOfBoundsException if the index is out of range
* {@code (index < -1 || (certPath != null && index >=
* certPath.getCertificates().size()) }
- * @throws IllegalArgumentException if certPath is
- * null and index is not -1
- * @throws NullPointerException if reason is null
+ * @throws IllegalArgumentException if {@code certPath} is
+ * {@code null} and {@code index} is not -1
+ * @throws NullPointerException if {@code reason} is {@code null}
*
* @since 1.7
*/
@@ -194,8 +194,8 @@ public class CertPathValidatorException extends GeneralSecurityException {
* Returns the certification path that was being validated when
* the exception was thrown.
*
- * @return the CertPath that was being validated when
- * the exception was thrown (or null if not specified)
+ * @return the {@code CertPath} that was being validated when
+ * the exception was thrown (or {@code null} if not specified)
*/
public CertPath getCertPath() {
return this.certPath;
@@ -204,7 +204,7 @@ public class CertPathValidatorException extends GeneralSecurityException {
/**
* Returns the index of the certificate in the certification path
* that caused the exception to be thrown. Note that the list of
- * certificates in a CertPath is zero based. If no
+ * certificates in a {@code CertPath} is zero based. If no
* index has been set, -1 is returned.
*
* @return the index that has been set, or -1 if none has been set
@@ -219,7 +219,7 @@ public class CertPathValidatorException extends GeneralSecurityException {
* {@link #getIndex}.
*
* @return the reason that the validation failed, or
- * BasicReason.UNSPECIFIED if a reason has not been
+ * {@code BasicReason.UNSPECIFIED} if a reason has not been
* specified
*
* @since 1.7
diff --git a/src/share/classes/java/security/cert/CertPathValidatorResult.java b/src/share/classes/java/security/cert/CertPathValidatorResult.java
index 1756db6329ffc2525b19463c46a2ff582e186008..ae07dc497a9128f90aa45f3d76340acc9ec3d2ca 100644
--- a/src/share/classes/java/security/cert/CertPathValidatorResult.java
+++ b/src/share/classes/java/security/cert/CertPathValidatorResult.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
@@ -41,10 +41,10 @@ package java.security.cert;
public interface CertPathValidatorResult extends Cloneable {
/**
- * Makes a copy of this CertPathValidatorResult. Changes to the
+ * Makes a copy of this {@code CertPathValidatorResult}. Changes to the
* copy will not affect the original and vice versa.
*
- * @return a copy of this CertPathValidatorResult
+ * @return a copy of this {@code CertPathValidatorResult}
*/
Object clone();
}
diff --git a/src/share/classes/java/security/cert/CertPathValidatorSpi.java b/src/share/classes/java/security/cert/CertPathValidatorSpi.java
index 6d3bd8c9968dd335410c954555237ab5094c57d3..50ad9c85c9bb86801339f4fb25bb2a4e54812270 100644
--- a/src/share/classes/java/security/cert/CertPathValidatorSpi.java
+++ b/src/share/classes/java/security/cert/CertPathValidatorSpi.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2012, 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,23 +31,23 @@ import java.security.InvalidAlgorithmParameterException;
*
* The Service Provider Interface (SPI)
* for the {@link CertPathValidator CertPathValidator} class. All
- * CertPathValidator implementations must include a class (the
- * SPI class) that extends this class (CertPathValidatorSpi)
+ * {@code CertPathValidator} implementations must include a class (the
+ * SPI class) that extends this class ({@code CertPathValidatorSpi})
* and implements all of its methods. In general, instances of this class
- * should only be accessed through the CertPathValidator class.
+ * should only be accessed through the {@code CertPathValidator} class.
* For details, see the Java Cryptography Architecture.
*
* Concurrent Access
*
* Instances of this class need not be protected against concurrent
* access from multiple threads. Threads that need to access a single
- * CertPathValidatorSpi instance concurrently should synchronize
+ * {@code CertPathValidatorSpi} instance concurrently should synchronize
* amongst themselves and provide the necessary locking before calling the
- * wrapping CertPathValidator object.
+ * wrapping {@code CertPathValidator} object.
*
- * However, implementations of CertPathValidatorSpi may still
+ * However, implementations of {@code CertPathValidatorSpi} may still
* encounter concurrency issues, since multiple threads each
- * manipulating a different CertPathValidatorSpi instance need not
+ * manipulating a different {@code CertPathValidatorSpi} instance need not
* synchronize.
*
* @since 1.4
@@ -64,20 +64,20 @@ public abstract class CertPathValidatorSpi {
* Validates the specified certification path using the specified
* algorithm parameter set.
*
- * The CertPath specified must be of a type that is
+ * The {@code CertPath} specified must be of a type that is
* supported by the validation algorithm, otherwise an
- * InvalidAlgorithmParameterException will be thrown. For
- * example, a CertPathValidator that implements the PKIX
- * algorithm validates CertPath objects of type X.509.
+ * {@code InvalidAlgorithmParameterException} will be thrown. For
+ * example, a {@code CertPathValidator} that implements the PKIX
+ * algorithm validates {@code CertPath} objects of type X.509.
*
- * @param certPath the CertPath to be validated
+ * @param certPath the {@code CertPath} to be validated
* @param params the algorithm parameters
* @return the result of the validation algorithm
- * @exception CertPathValidatorException if the CertPath
+ * @exception CertPathValidatorException if the {@code CertPath}
* does not validate
* @exception InvalidAlgorithmParameterException if the specified
- * parameters or the type of the specified CertPath are
- * inappropriate for this CertPathValidator
+ * parameters or the type of the specified {@code CertPath} are
+ * inappropriate for this {@code CertPathValidator}
*/
public abstract CertPathValidatorResult
engineValidate(CertPath certPath, CertPathParameters params)
diff --git a/src/share/classes/java/security/cert/CertSelector.java b/src/share/classes/java/security/cert/CertSelector.java
index 5ee1f7156cdc8ca522dd94f43f89df8ee12d5a05..a06cc848019d4bec6a55e06121e8700c71ea87a2 100644
--- a/src/share/classes/java/security/cert/CertSelector.java
+++ b/src/share/classes/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 @@ package java.security.cert;
/**
* A selector that defines a set of criteria for selecting
- * Certificates. Classes that implement this interface
- * are often used to specify which Certificates should
- * be retrieved from a CertStore.
+ * {@code Certificate}s. Classes that implement this interface
+ * are often used to specify which {@code Certificate}s should
+ * be retrieved from a {@code CertStore}.
*
* Concurrent Access
*
@@ -49,19 +49,19 @@ package java.security.cert;
public interface CertSelector extends Cloneable {
/**
- * Decides whether a Certificate should be selected.
+ * Decides whether a {@code Certificate} should be selected.
*
- * @param cert the Certificate to be checked
- * @return true if the Certificate
- * should be selected, false 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 CertSelector. 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 CertSelector
+ * @return a copy of this {@code CertSelector}
*/
Object clone();
}
diff --git a/src/share/classes/java/security/cert/CertStore.java b/src/share/classes/java/security/cert/CertStore.java
index 1c6dedbf53cc32fff3b372238dc9fa2edad6b7ee..1a8ed628c137be644d18e359e634907dce37b601 100644
--- a/src/share/classes/java/security/cert/CertStore.java
+++ b/src/share/classes/java/security/cert/CertStore.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2012, 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,32 +38,32 @@ import sun.security.jca.*;
import sun.security.jca.GetInstance.Instance;
/**
- * A class for retrieving Certificates and CRLs
+ * A class for retrieving {@code Certificate}s and {@code CRL}s
* from a repository.
*
* This class uses a provider-based architecture.
- * To create a CertStore, call one of the static
- * getInstance methods, passing in the type of
- * CertStore 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.
*
- * Once the CertStore has been created, it can be used to
- * retrieve Certificates and CRLs 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.
*
* Unlike a {@link java.security.KeyStore KeyStore}, which provides access
* to a cache of private keys and trusted certificates, a
- * CertStore 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 CertStore 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.
*
*
Every implementation of the Java platform is required to support the
- * following standard CertStore type:
+ * following standard {@code CertStore} type:
*
A new CertStore object encapsulating the
* CertStoreSpi implementation from the specified provider
@@ -255,23 +255,23 @@ public class CertStore {
*
Note that the list of registered providers may be retrieved via
* the {@link Security#getProviders() Security.getProviders()} method.
*
- *
The CertStore that is returned is initialized with the
- * specified CertStoreParameters. The type of parameters
- * needed may vary between different types of CertStores.
- * Note that the specified CertStoreParameters object is
+ *
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 CertStore type.
+ * @param type the requested {@code CertStore} type.
* See the CertStore section in the
* Java Cryptography Architecture Standard Algorithm Name Documentation
* for information about standard types.
*
- * @param params the initialization parameters (may be null).
+ * @param params the initialization parameters (may be {@code null}).
*
* @param provider the name of the provider.
*
- * @return a CertStore object that implements the
+ * @return a {@code CertStore} object that implements the
* specified type.
*
* @throws NoSuchAlgorithmException if a CertStoreSpi
@@ -280,12 +280,12 @@ public class CertStore {
*
* @throws InvalidAlgorithmParameterException if the specified
* initialization parameters are inappropriate for this
- * CertStore.
+ * {@code CertStore}.
*
* @throws NoSuchProviderException if the specified provider is not
* registered in the security provider list.
*
- * @exception IllegalArgumentException if the provider is
+ * @exception IllegalArgumentException if the {@code provider} is
* null or empty.
*
* @see java.security.Provider
@@ -305,31 +305,31 @@ public class CertStore {
}
/**
- * Returns a CertStore object that implements the specified
- * CertStore type.
+ * Returns a {@code CertStore} object that implements the specified
+ * {@code CertStore} type.
*
*
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.
*
- *
The CertStore that is returned is initialized with the
- * specified CertStoreParameters. The type of parameters
- * needed may vary between different types of CertStores.
- * Note that the specified CertStoreParameters object is
+ *
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 CertStore type.
+ * @param type the requested {@code CertStore} type.
* See the CertStore section in the
* Java Cryptography Architecture Standard Algorithm Name Documentation
* for information about standard types.
*
- * @param params the initialization parameters (may be null).
+ * @param params the initialization parameters (may be {@code null}).
*
* @param provider the provider.
*
- * @return a CertStore object that implements the
+ * @return a {@code CertStore} object that implements the
* specified type.
*
* @exception NoSuchAlgorithmException if a CertStoreSpi
@@ -338,9 +338,9 @@ public class CertStore {
*
* @throws InvalidAlgorithmParameterException if the specified
* initialization parameters are inappropriate for this
- * CertStore
+ * {@code CertStore}
*
- * @exception IllegalArgumentException if the provider is
+ * @exception IllegalArgumentException if the {@code provider} is
* null.
*
* @see java.security.Provider
@@ -359,30 +359,30 @@ public class CertStore {
}
/**
- * Returns the parameters used to initialize this CertStore.
- * Note that the CertStoreParameters 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 CertStore
- * (may be null)
+ * @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 CertStore.
+ * Returns the type of this {@code CertStore}.
*
- * @return the type of this CertStore
+ * @return the type of this {@code CertStore}
*/
public final String getType() {
return this.type;
}
/**
- * Returns the provider of this CertStore.
+ * Returns the provider of this {@code CertStore}.
*
- * @return the provider of this CertStore
+ * @return the provider of this {@code CertStore}
*/
public final Provider getProvider() {
return this.provider;
diff --git a/src/share/classes/java/security/cert/CertStoreException.java b/src/share/classes/java/security/cert/CertStoreException.java
index 31baf644e302342e18a77bd5fe2e12480fa337ba..77b1c234664486d45d96a7b9ed7b8f91ddd62717 100644
--- a/src/share/classes/java/security/cert/CertStoreException.java
+++ b/src/share/classes/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 @@ import java.security.GeneralSecurityException;
/**
* An exception indicating one of a variety of problems retrieving
- * certificates and CRLs from a CertStore.
+ * certificates and CRLs from a {@code CertStore}.
*
- * A CertStoreException 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.
*
@@ -53,7 +53,7 @@ public class CertStoreException extends GeneralSecurityException {
private static final long serialVersionUID = 2395296107471573245L;
/**
- * Creates a CertStoreException with null as
+ * Creates a {@code CertStoreException} with {@code null} as
* its detail message.
*/
public CertStoreException() {
@@ -61,8 +61,8 @@ public class CertStoreException extends GeneralSecurityException {
}
/**
- * Creates a CertStoreException with the given detail
- * message. A detail message is a String 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 @@ public class CertStoreException extends GeneralSecurityException {
}
/**
- * Creates a CertStoreException that wraps the specified
+ * Creates a {@code CertStoreException} that wraps the specified
* throwable. This allows any exception to be converted into a
- * CertStoreException, 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 (cause==null ? null : cause.toString()) (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 null 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 @@ public class CertStoreException extends GeneralSecurityException {
}
/**
- * Creates a CertStoreException 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 null 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/src/share/classes/java/security/cert/CertStoreParameters.java b/src/share/classes/java/security/cert/CertStoreParameters.java
index d410dc7f3320c9e18cd5ea0d38065466e8958504..9938ba2543880fc803ff3de76f51020becd2b38f 100644
--- a/src/share/classes/java/security/cert/CertStoreParameters.java
+++ b/src/share/classes/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 CertStore parameters.
+ * A specification of {@code CertStore} parameters.
*
* The purpose of this interface is to group (and provide type safety for)
- * all CertStore parameter specifications. All
- * CertStore parameter specifications must implement this
+ * all {@code CertStore} parameter specifications. All
+ * {@code CertStore} parameter specifications must implement this
* interface.
*
- * Typically, a CertStoreParameters 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 getInstance method returns a CertStore that
- * is used for retrieving Certificates and CRLs. The
- * CertStore 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 CertStores.
+ * of {@code CertStore}s.
*
* @see CertStore#getInstance
*
@@ -49,32 +49,32 @@ package java.security.cert;
public interface CertStoreParameters extends Cloneable {
/**
- * Makes a copy of this CertStoreParameters.
+ * Makes a copy of this {@code CertStoreParameters}.
*
* The precise meaning of "copy" may depend on the class of
- * the CertStoreParameters 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.
*
- * Note that the CertStore.getInstance methods make a copy
- * of the specified CertStoreParameters. A deep copy
- * implementation of clone is safer and more robust, as it
- * prevents the caller from corrupting a shared CertStore 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 clone 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 CertStoreParameters. For example,
+ * parameter contained in the {@code CertStoreParameters}. For example,
* a shallow copy clone allows an application to release the resources of
- * a particular CertStore 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 CertStore may still
+ * be done with the utmost care, since the {@code CertStore} may still
* be in use by other threads.
*
* Each subclass should state the precise behavior of this method so
* that users and developers know what to expect.
*
- * @return a copy of this CertStoreParameters
+ * @return a copy of this {@code CertStoreParameters}
*/
Object clone();
}
diff --git a/src/share/classes/java/security/cert/CertStoreSpi.java b/src/share/classes/java/security/cert/CertStoreSpi.java
index ddcf2bc3f37b2f3c737d5338a2ba725379fd2976..fc98e9ebcf0b7da06349b219f73e1ab985e0cff2 100644
--- a/src/share/classes/java/security/cert/CertStoreSpi.java
+++ b/src/share/classes/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 @@ import java.util.Collection;
/**
* The Service Provider Interface (SPI)
- * for the {@link CertStore CertStore} class. All CertStore
+ * for the {@link CertStore CertStore} class. All {@code CertStore}
* implementations must include a class (the SPI class) that extends
- * this class (CertStoreSpi), provides a constructor with
- * a single argument of type CertStoreParameters, 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 CertStore class.
+ * accessed through the {@code CertStore} class.
* For details, see the Java Cryptography Architecture.
*
* Concurrent Access
*
- * The public methods of all CertStoreSpi 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 CertStoreSpi object (or more than one)
- * with no ill effects. This allows a CertPathBuilder 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.
*
- * Simple CertStoreSpi implementations will probably ensure
- * thread safety by adding a synchronized keyword to their
- * engineGetCertificates and engineGetCRLs 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 @@ public abstract class CertStoreSpi {
/**
* The sole constructor.
*
- * @param params the initialization parameters (may be null)
+ * @param params the initialization parameters (may be {@code null})
* @throws InvalidAlgorithmParameterException if the initialization
- * parameters are inappropriate for this CertStoreSpi
+ * parameters are inappropriate for this {@code CertStoreSpi}
*/
public CertStoreSpi(CertStoreParameters params)
throws InvalidAlgorithmParameterException { }
/**
- * Returns a Collection of Certificates that
- * match the specified selector. If no Certificates
- * match the selector, an empty Collection 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.
*
- * For some CertStore types, the resulting
- * Collection may not contain all of the
- * Certificates that match the selector. For instance,
- * an LDAP CertStore may not search all entries in the
+ * For some {@code CertStore} types, the resulting
+ * {@code Collection} may not contain all 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 Certificates it is looking for.
+ * contain the {@code Certificate}s it is looking for.
*
- * Some CertStore implementations (especially LDAP
- * CertStores) may throw a CertStoreException
- * unless a non-null CertSelector 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 CertSelector used to select which
- * Certificates should be returned. Specify null
- * to return all Certificates (if supported).
- * @return A Collection of Certificates that
- * match the specified selector (never null)
+ * @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 Collection of CRLs that
- * match the specified selector. If no CRLs
- * match the selector, an empty Collection 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.
*
- * For some CertStore types, the resulting
- * Collection may not contain all of the
- * CRLs that match the selector. For instance,
- * an LDAP CertStore may not search all entries in the
+ * For some {@code CertStore} types, the resulting
+ * {@code Collection} may not contain all 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 CRLs it is looking for.
+ * contain the {@code CRL}s it is looking for.
*
- * Some CertStore implementations (especially LDAP
- * CertStores) may throw a CertStoreException
- * unless a non-null CRLSelector 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 CRLSelector used to select which
- * CRLs should be returned. Specify null
- * to return all CRLs (if supported).
- * @return A Collection of CRLs that
- * match the specified selector (never null)
+ * @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/src/share/classes/java/security/cert/Certificate.java b/src/share/classes/java/security/cert/Certificate.java
index 80390ac129c3f09af59ee2e57a5611f7c354d4bc..638a02e6f806686024f96a389dc9aef0b26364d7 100644
--- a/src/share/classes/java/security/cert/Certificate.java
+++ b/src/share/classes/java/security/cert/Certificate.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, 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
@@ -90,8 +90,8 @@ public abstract class Certificate implements java.io.Serializable {
/**
* Compares this certificate for equality with the specified
- * object. If the other object is an
- * instanceofCertificate, then
+ * object. If the {@code other} object is an
+ * {@code instanceof} {@code Certificate}, then
* its encoded form is retrieved and compared with the
* encoded form of this certificate.
*
@@ -196,8 +196,8 @@ public abstract class Certificate implements java.io.Serializable {
*
*
This method was added to version 1.8 of the Java Platform
* Standard Edition. In order to maintain backwards compatibility with
- * existing service providers, this method cannot be abstract
- * and by default throws an UnsupportedOperationException.
+ * existing service providers, this method cannot be {@code abstract}
+ * and by default throws an {@code UnsupportedOperationException}.
*
* @param key the PublicKey used to carry out the verification.
* @param sigProvider the signature provider.
diff --git a/src/share/classes/java/security/cert/CertificateEncodingException.java b/src/share/classes/java/security/cert/CertificateEncodingException.java
index dbfc22ca8cea5a592fade2f40488f6957fca609b..618ee0a55b93410f12e99d961d99987b581fe01e 100644
--- a/src/share/classes/java/security/cert/CertificateEncodingException.java
+++ b/src/share/classes/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 @@ public class CertificateEncodingException extends CertificateException {
}
/**
- * Creates a CertificateEncodingException 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 null 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 @@ public class CertificateEncodingException extends CertificateException {
}
/**
- * Creates a CertificateEncodingException
+ * Creates a {@code CertificateEncodingException}
* with the specified cause and a detail message of
- * (cause==null ? null : cause.toString())
+ * {@code (cause==null ? null : cause.toString())}
* (which typically contains the class and detail message of
- * cause).
+ * {@code cause}).
*
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A null 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/src/share/classes/java/security/cert/CertificateException.java b/src/share/classes/java/security/cert/CertificateException.java
index 1c91f9f0ebb0c997af491960720a438ea8168e3d..f663054000b1130c98c4fbd5a61336e19fad9b0a 100644
--- a/src/share/classes/java/security/cert/CertificateException.java
+++ b/src/share/classes/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 @@ public class CertificateException extends GeneralSecurityException {
}
/**
- * Creates a CertificateException 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 null 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 @@ public class CertificateException extends GeneralSecurityException {
}
/**
- * Creates a CertificateException with the specified cause
- * and a detail message of (cause==null ? null : cause.toString())
+ * 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
- * cause).
+ * {@code cause}).
*
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A null 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/src/share/classes/java/security/cert/CertificateExpiredException.java b/src/share/classes/java/security/cert/CertificateExpiredException.java
index e5644fa7ff098445c2fa8b1a1eacaaeb94d85b43..9de0c236c1373bf7f8c3a6358b1e69f518e7098d 100644
--- a/src/share/classes/java/security/cert/CertificateExpiredException.java
+++ b/src/share/classes/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 @@ package java.security.cert;
/**
* Certificate Expired Exception. This is thrown whenever the current
- * Date or the specified Date is after the
- * notAfter 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/src/share/classes/java/security/cert/CertificateFactory.java b/src/share/classes/java/security/cert/CertificateFactory.java
index d0762df16be2a656a05901216a55c457de3f04e0..83ff9fbee927562674c5d00b2e9ca26a0d2d196b 100644
--- a/src/share/classes/java/security/cert/CertificateFactory.java
+++ b/src/share/classes/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,27 +41,27 @@ import sun.security.jca.GetInstance.Instance;
/**
* This class defines the functionality of a certificate factory, which is
- * used to generate certificate, certification path (CertPath)
+ * used to generate certificate, certification path ({@code CertPath})
* and certificate revocation list (CRL) objects from their encodings.
*
*
For encodings consisting of multiple certificates, use
- * generateCertificates when you want to
+ * {@code generateCertificates} when you want to
* parse a collection of possibly unrelated certificates. Otherwise,
- * use generateCertPath when you want to generate
- * a CertPath (a certificate chain) and subsequently
- * validate it with a CertPathValidator.
+ * use {@code generateCertPath} when you want to generate
+ * a {@code CertPath} (a certificate chain) and subsequently
+ * validate it with a {@code CertPathValidator}.
*
*
A certificate factory for X.509 must return certificates that are an
- * instance of java.security.cert.X509Certificate, and CRLs
- * that are an instance of java.security.cert.X509CRL.
+ * instance of {@code java.security.cert.X509Certificate}, and CRLs
+ * that are an instance of {@code java.security.cert.X509CRL}.
*
*
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
- * FileInputStream (which does not support mark
- * and reset) to a BufferedInputStream (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
- * generateCertificate 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:
Every implementation of the Java platform is required to support the
- * following standard CertificateFactory type:
+ * following standard {@code CertificateFactory} type:
*
- *
X.509
+ *
{@code X.509}
*
- * and the following standard CertPath encodings:
+ * and the following standard {@code CertPath} encodings:
*
- * Attempts to modify the returned Iterator via its
- * remove method result in an
- * UnsupportedOperationException.
+ * Attempts to modify the returned {@code Iterator} via its
+ * {@code remove} method result in an
+ * {@code UnsupportedOperationException}.
*
- * @return an Iterator over the names of the supported
- * CertPath encodings (as Strings)
+ * @return an {@code Iterator} over the names of the supported
+ * {@code CertPath} encodings (as {@code String}s)
* @since 1.4
*/
public final Iterator getCertPathEncodings() {
@@ -360,15 +360,15 @@ public class CertificateFactory {
}
/**
- * Generates a CertPath object and initializes it with
- * the data read from the InputStream 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 Iterator returned by
+ * encoding is the first element of the {@code Iterator} returned by
* the {@link #getCertPathEncodings getCertPathEncodings} method.
*
- * @param inStream an InputStream containing the data
- * @return a CertPath initialized with the data from the
- * InputStream
+ * @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
*/
@@ -379,18 +379,18 @@ public class CertificateFactory {
}
/**
- * Generates a CertPath object and initializes it with
- * the data read from the InputStream 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
* Java Cryptography Architecture Standard Algorithm Name Documentation
* for information about standard encoding names and their formats.
*
- * @param inStream an InputStream containing the data
+ * @param inStream an {@code InputStream} containing the data
* @param encoding the encoding used for the data
- * @return a CertPath initialized with the data from the
- * InputStream
+ * @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
@@ -402,15 +402,15 @@ public class CertificateFactory {
}
/**
- * Generates a CertPath object and initializes it with
- * a List of Certificates.
+ * Generates a {@code CertPath} object and initializes it with
+ * a {@code List} of {@code Certificate}s.
*
* The certificates supplied must be of a type supported by the
- * CertificateFactory. They will be copied out of the supplied
- * List object.
+ * {@code CertificateFactory}. They will be copied out of the supplied
+ * {@code List} object.
*
- * @param certificates a List of Certificates
- * @return a CertPath 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
@@ -424,20 +424,20 @@ public class CertificateFactory {
/**
* Returns a (possibly empty) collection view of the certificates read
- * from the given input stream inStream.
+ * from the given input stream {@code inStream}.
*
*
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 X509Certificate class.
+ * collection can be typecast to the {@code X509Certificate} class.
*
*
In the case of a certificate factory for X.509 certificates,
- * inStream 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, inStream may contain a PKCS#7 certificate
+ * In addition, {@code inStream} may contain a PKCS#7 certificate
* chain. This is a PKCS#7 SignedData object, with the only
* significant field being certificates. In particular, the
* signature and the contents are ignored. This format allows multiple
@@ -464,14 +464,14 @@ public class CertificateFactory {
/**
* Generates a certificate revocation list (CRL) object and initializes it
- * with the data read from the input stream inStream.
+ * with the data read from the input stream {@code inStream}.
*
*
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 X509CRL class.
+ * can be typecast to the {@code X509CRL} class.
*
*
Note that if the given input stream does not support
* {@link java.io.InputStream#mark(int) mark} and
@@ -482,7 +482,7 @@ public class CertificateFactory {
* 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
- * CRLException is thrown.
+ * {@code CRLException} is thrown.
*
* @param inStream an input stream with the CRL data.
*
@@ -499,18 +499,18 @@ public class CertificateFactory {
/**
* Returns a (possibly empty) collection view of the CRLs read
- * from the given input stream inStream.
+ * from the given input stream {@code inStream}.
*
*
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 X509CRL class.
+ * collection can be typecast to the {@code X509CRL} class.
*
*
In the case of a certificate factory for X.509 CRLs,
- * inStream may contain a sequence of DER-encoded CRLs.
- * In addition, inStream 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 SignedData object, with the only
* significant field being crls. In particular, the
* signature and the contents are ignored. This format allows multiple
diff --git a/src/share/classes/java/security/cert/CertificateFactorySpi.java b/src/share/classes/java/security/cert/CertificateFactorySpi.java
index 0912ba2a9f925d6b98dc8a21c837dd3ef4e651bb..35aee847bb83c5756771821484acf8484325612f 100644
--- a/src/share/classes/java/security/cert/CertificateFactorySpi.java
+++ b/src/share/classes/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 @@ import java.security.NoSuchProviderException;
/**
* This class defines the Service Provider Interface (SPI)
- * for the CertificateFactory 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.
*
*
Certificate factories are used to generate certificate, certification path
- * (CertPath) and certificate revocation list (CRL) objects from
+ * ({@code CertPath}) and certificate revocation list (CRL) objects from
* their encodings.
*
*
A certificate factory for X.509 must return certificates that are an
- * instance of java.security.cert.X509Certificate, and CRLs
- * that are an instance of java.security.cert.X509CRL.
+ * 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 @@ public abstract class CertificateFactorySpi {
/**
* Generates a certificate object and initializes it with
- * the data read from the input stream inStream.
+ * the data read from the input stream {@code inStream}.
*
*
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 X509Certificate class.
+ * can be typecast to the {@code X509Certificate} class.
*
*
In the case of a certificate factory for X.509 certificates, the
- * certificate provided in inStream 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 @@ public abstract class CertificateFactorySpi {
* 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
- * CertificateException is thrown.
+ * {@code CertificateException} is thrown.
*
* @param inStream an input stream with the certificate data.
*
@@ -105,18 +105,18 @@ public abstract class CertificateFactorySpi {
throws CertificateException;
/**
- * Generates a CertPath object and initializes it with
- * the data read from the InputStream 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.
*
*
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 abstract
- * and by default throws an UnsupportedOperationException.
+ * existing service providers, this method cannot be {@code abstract}
+ * and by default throws an {@code UnsupportedOperationException}.
*
- * @param inStream an InputStream containing the data
- * @return a CertPath initialized with the data from the
- * InputStream
+ * @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 @@ public abstract class CertificateFactorySpi {
}
/**
- * Generates a CertPath object and initializes it with
- * the data read from the InputStream 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.
*
*
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 abstract
- * and by default throws an UnsupportedOperationException.
+ * existing service providers, this method cannot be {@code abstract}
+ * and by default throws an {@code UnsupportedOperationException}.
*
- * @param inStream an InputStream containing the data
+ * @param inStream an {@code InputStream} containing the data
* @param encoding the encoding used for the data
- * @return a CertPath initialized with the data from the
- * InputStream
+ * @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 @@ public abstract class CertificateFactorySpi {
}
/**
- * Generates a CertPath object and initializes it with
- * a List of Certificates.
+ * Generates a {@code CertPath} object and initializes it with
+ * a {@code List} of {@code Certificate}s.
*
* The certificates supplied must be of a type supported by the
- * CertificateFactory. They will be copied out of the supplied
- * List object.
+ * {@code CertificateFactory}. They will be copied out of the supplied
+ * {@code List} object.
*
*
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 abstract
- * and by default throws an UnsupportedOperationException.
+ * existing service providers, this method cannot be {@code abstract}
+ * and by default throws an {@code UnsupportedOperationException}.
*
- * @param certificates a List of Certificates
- * @return a CertPath 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 @@ public abstract class CertificateFactorySpi {
}
/**
- * Returns an iteration of the CertPath 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
* Java Cryptography Architecture Standard Algorithm Name Documentation
* for information about standard encoding names.
*
- * Attempts to modify the returned Iterator via its
- * remove method result in an
- * UnsupportedOperationException.
+ * Attempts to modify the returned {@code Iterator} via its
+ * {@code remove} method result in an
+ * {@code UnsupportedOperationException}.
*
*
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 abstract
- * and by default throws an UnsupportedOperationException.
+ * existing service providers, this method cannot be {@code abstract}
+ * and by default throws an {@code UnsupportedOperationException}.
*
- * @return an Iterator over the names of the supported
- * CertPath encodings (as Strings)
+ * @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 @@ public abstract class CertificateFactorySpi {
/**
* Returns a (possibly empty) collection view of the certificates read
- * from the given input stream inStream.
+ * from the given input stream {@code inStream}.
*
*
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 X509Certificate class.
+ * collection can be typecast to the {@code X509Certificate} class.
*
*
In the case of a certificate factory for X.509 certificates,
- * inStream 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, inStream may contain a PKCS#7 certificate
+ * In addition, {@code inStream} may contain a PKCS#7 certificate
* chain. This is a PKCS#7 SignedData object, with the only
* significant field being certificates. In particular, the
* signature and the contents are ignored. This format allows multiple
@@ -247,14 +247,14 @@ public abstract class CertificateFactorySpi {
/**
* Generates a certificate revocation list (CRL) object and initializes it
- * with the data read from the input stream inStream.
+ * with the data read from the input stream {@code inStream}.
*
*
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 X509CRL class.
+ * can be typecast to the {@code X509CRL} class.
*
*
Note that if the given input stream does not support
* {@link java.io.InputStream#mark(int) mark} and
@@ -265,7 +265,7 @@ public abstract class CertificateFactorySpi {
* 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
- * CRLException is thrown.
+ * {@code CRLException} is thrown.
*
* @param inStream an input stream with the CRL data.
*
@@ -279,18 +279,18 @@ public abstract class CertificateFactorySpi {
/**
* Returns a (possibly empty) collection view of the CRLs read
- * from the given input stream inStream.
+ * from the given input stream {@code inStream}.
*
*
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 X509CRL class.
+ * collection can be typecast to the {@code X509CRL} class.
*
*
In the case of a certificate factory for X.509 CRLs,
- * inStream may contain a single DER-encoded CRL.
- * In addition, inStream 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 SignedData object, with the only
* significant field being crls. In particular, the
* signature and the contents are ignored. This format allows multiple
diff --git a/src/share/classes/java/security/cert/CertificateNotYetValidException.java b/src/share/classes/java/security/cert/CertificateNotYetValidException.java
index 13da51d06f3c8e4348010d5e009b4ccb9b66f5d7..e8722bd339ddba5a98699021d431f1cc81497816 100644
--- a/src/share/classes/java/security/cert/CertificateNotYetValidException.java
+++ b/src/share/classes/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 @@ package java.security.cert;
/**
* Certificate is not yet valid exception. This is thrown whenever
- * the current Date or the specified Date
- * is before the notBefore 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/src/share/classes/java/security/cert/CertificateParsingException.java b/src/share/classes/java/security/cert/CertificateParsingException.java
index 3432fb09af6847a4b9476623488dd1927008bc48..06a7d603f29eef9b486e861751570de393d07934 100644
--- a/src/share/classes/java/security/cert/CertificateParsingException.java
+++ b/src/share/classes/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 @@ public class CertificateParsingException extends CertificateException {
}
/**
- * Creates a CertificateParsingException 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 null 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 @@ public class CertificateParsingException extends CertificateException {
}
/**
- * Creates a CertificateParsingException with the
+ * Creates a {@code CertificateParsingException} with the
* specified cause and a detail message of
- * (cause==null ? null : cause.toString())
+ * {@code (cause==null ? null : cause.toString())}
* (which typically contains the class and detail message of
- * cause).
+ * {@code cause}).
*
* @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A null 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/src/share/classes/java/security/cert/CertificateRevokedException.java b/src/share/classes/java/security/cert/CertificateRevokedException.java
index b812689ee6e5366fab61d550924c688c733818f2..c50a224861ab2c8c7e870c8373ca965aac991665 100644
--- a/src/share/classes/java/security/cert/CertificateRevokedException.java
+++ b/src/share/classes/java/security/cert/CertificateRevokedException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2011, 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
@@ -39,7 +39,7 @@ import sun.security.x509.InvalidityDateExtension;
/**
* An exception that indicates an X.509 certificate is revoked. A
- * CertificateRevokedException 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.
*
@@ -60,7 +60,7 @@ public class CertificateRevokedException extends CertificateException {
*/
private final CRLReason reason;
/**
- * @serial the X500Principal 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;
@@ -68,7 +68,7 @@ public class CertificateRevokedException extends CertificateException {
private transient Map extensions;
/**
- * Constructs a CertificateRevokedException with
+ * Constructs a {@code CertificateRevokedException} with
* the specified revocation date, reason code, authority name, and map
* of extensions.
*
@@ -78,12 +78,12 @@ public class CertificateRevokedException extends CertificateException {
* @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 X500Principal 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 revocationDate,
- * reason, authority, or
- * extensions is null
+ * @throws NullPointerException if {@code revocationDate},
+ * {@code reason}, {@code authority}, or
+ * {@code extensions} is {@code null}
*/
public CertificateRevokedException(Date revocationDate, CRLReason reason,
X500Principal authority, Map extensions) {
@@ -121,7 +121,7 @@ public class CertificateRevokedException extends CertificateException {
* Returns the name of the authority that signed the certificate's
* revocation status information.
*
- * @return the X500Principal 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,16 +130,16 @@ public class CertificateRevokedException extends CertificateException {
/**
* Returns the invalidity date, as specifed in the Invalidity Date
- * extension of this CertificateRevokedException. The
+ * 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 getExtensions() 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 null if not specified
+ * @return the invalidity date, or {@code null} if not specified
*/
public Date getInvalidityDate() {
Extension ext = getExtensions().get("2.5.29.24");
@@ -176,7 +176,7 @@ public class CertificateRevokedException extends CertificateException {
}
/**
- * Serialize this CertificateRevokedException 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,
@@ -208,7 +208,7 @@ public class CertificateRevokedException extends CertificateException {
}
/**
- * Deserialize the CertificateRevokedException instance.
+ * Deserialize the {@code CertificateRevokedException} instance.
*/
private void readObject(ObjectInputStream ois)
throws IOException, ClassNotFoundException {
diff --git a/src/share/classes/java/security/cert/CollectionCertStoreParameters.java b/src/share/classes/java/security/cert/CollectionCertStoreParameters.java
index 56e25c94778c2003b539b1e33cc3212e06041539..12bd358cfff1ab13d967dcb384402d64c9c28d32 100644
--- a/src/share/classes/java/security/cert/CollectionCertStoreParameters.java
+++ b/src/share/classes/java/security/cert/CollectionCertStoreParameters.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
@@ -30,13 +30,13 @@ import java.util.Collection;
import java.util.Collections;
/**
- * Parameters used as input for the Collection CertStore
+ * Parameters used as input for the Collection {@code CertStore}
* algorithm.
*
* This class is used to provide necessary configuration parameters
- * to implementations of the Collection CertStore
+ * to implementations of the Collection {@code CertStore}
* algorithm. The only parameter included in this class is the
- * Collection from which the CertStore will
+ * {@code Collection} from which the {@code CertStore} will
* retrieve certificates and CRLs.
*
* Concurrent Access
@@ -58,30 +58,30 @@ public class CollectionCertStoreParameters
private Collection> coll;
/**
- * Creates an instance of CollectionCertStoreParameters
+ * Creates an instance of {@code CollectionCertStoreParameters}
* which will allow certificates and CRLs to be retrieved from the
- * specified Collection. If the specified
- * Collection contains an object that is not a
- * Certificate or CRL, that object will be
- * ignored by the Collection CertStore.
+ * 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}.
*
- * The Collection is not copied. Instead, a
+ * The {@code Collection} is not copied. Instead, a
* reference is used. This allows the caller to subsequently add or
- * remove Certificates or CRLs from the
- * Collection, thus changing the set of
- * Certificates or CRLs available to the
- * Collection CertStore. The Collection CertStore
- * will not modify the contents of the Collection.
+ * 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}.
*
- * If the Collection will be modified by one thread while
- * another thread is calling a method of a Collection CertStore
- * that has been initialized with this Collection, the
- * Collection 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 Collection of
- * Certificates and CRLs
- * @exception NullPointerException if collection is
- * null
+ * @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 @@ public class CollectionCertStoreParameters
}
/**
- * Creates an instance of CollectionCertStoreParameters with
+ * Creates an instance of {@code CollectionCertStoreParameters} with
* the default parameter values (an empty and immutable
- * Collection).
+ * {@code Collection}).
*/
public CollectionCertStoreParameters() {
coll = Collections.EMPTY_SET;
}
/**
- * Returns the Collection from which Certificates
- * and CRLs are retrieved. This is not a copy of the
- * Collection, it is a reference. This allows the caller to
- * subsequently add or remove Certificates or
- * CRLs from the Collection.
+ * Returns the {@code Collection} from which {@code Certificate}s
+ * and {@code CRL}s are retrieved. This is not 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 Collection (never null)
+ * @return the {@code Collection} (never null)
*/
public Collection> getCollection() {
return coll;
@@ -113,7 +113,7 @@ public class CollectionCertStoreParameters
/**
* Returns a copy of this object. Note that only a reference to the
- * Collection is copied, and not the contents.
+ * {@code Collection} is copied, and not the contents.
*
* @return the copy
*/
diff --git a/src/share/classes/java/security/cert/Extension.java b/src/share/classes/java/security/cert/Extension.java
index cbf89d5cdba6f1570386032dcc7871e531949f6a..98e827c59192c0db0301ee4c47dcbbc366535373 100644
--- a/src/share/classes/java/security/cert/Extension.java
+++ b/src/share/classes/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 @@ public interface Extension {
* 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 null 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 @@ public interface Extension {
*
* @param out the output stream
* @exception IOException on encoding or output error.
- * @exception NullPointerException if out is null.
+ * @exception NullPointerException if {@code out} is {@code null}.
*/
void encode(OutputStream out) throws IOException;
}
diff --git a/src/share/classes/java/security/cert/LDAPCertStoreParameters.java b/src/share/classes/java/security/cert/LDAPCertStoreParameters.java
index 5d8b4d599274df49ca9ae3eaa1e1cd36da52fd27..96fe9cd0939b09d9f41180cc92ee3feb2157247e 100644
--- a/src/share/classes/java/security/cert/LDAPCertStoreParameters.java
+++ b/src/share/classes/java/security/cert/LDAPCertStoreParameters.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
@@ -26,10 +26,10 @@
package java.security.cert;
/**
- * Parameters used as input for the LDAP CertStore algorithm.
+ * Parameters used as input for the LDAP {@code CertStore} algorithm.
*
* This class is used to provide necessary configuration parameters (server
- * name and port number) to implementations of the LDAP CertStore
+ * name and port number) to implementations of the LDAP {@code CertStore}
* algorithm.
*
* Concurrent Access
@@ -59,13 +59,13 @@ public class LDAPCertStoreParameters implements CertStoreParameters {
private String serverName;
/**
- * Creates an instance of LDAPCertStoreParameters 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 serverName is
- * null
+ * @exception NullPointerException if {@code serverName} is
+ * {@code null}
*/
public LDAPCertStoreParameters(String serverName, int port) {
if (serverName == null)
@@ -75,19 +75,19 @@ public class LDAPCertStoreParameters implements CertStoreParameters {
}
/**
- * Creates an instance of LDAPCertStoreParameters 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 serverName is
- * null
+ * @exception NullPointerException if {@code serverName} is
+ * {@code null}
*/
public LDAPCertStoreParameters(String serverName) {
this(serverName, LDAP_DEFAULT_PORT);
}
/**
- * Creates an instance of LDAPCertStoreParameters with the
+ * Creates an instance of {@code LDAPCertStoreParameters} with the
* default parameter values (server name "localhost", port 389).
*/
public LDAPCertStoreParameters() {
@@ -97,7 +97,7 @@ public class LDAPCertStoreParameters implements CertStoreParameters {
/**
* Returns the DNS name of the LDAP server.
*
- * @return the name (not null)
+ * @return the name (not {@code null})
*/
public String getServerName() {
return serverName;
@@ -117,7 +117,7 @@ public class LDAPCertStoreParameters implements CertStoreParameters {
* the original and vice versa.
*
* Note: this method currently performs a shallow copy of the object
- * (simply calls Object.clone()). 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.
*
diff --git a/src/share/classes/java/security/cert/PKIXBuilderParameters.java b/src/share/classes/java/security/cert/PKIXBuilderParameters.java
index d1b27c6ffba65d0f79e55e9d12c23fa922bb6303..b33e1f8c1e20242ce34548d83b585047d0e1c158 100644
--- a/src/share/classes/java/security/cert/PKIXBuilderParameters.java
+++ b/src/share/classes/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.security.InvalidParameterException;
import java.util.Set;
/**
- * Parameters used as input for the PKIX CertPathBuilder
+ * Parameters used as input for the PKIX {@code CertPathBuilder}
* algorithm.
*
- * A PKIX CertPathBuilder uses these parameters to {@link
- * CertPathBuilder#build build} a CertPath 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.
*
- *
To instantiate a PKIXBuilderParameters object, an
+ *
To instantiate a {@code PKIXBuilderParameters} object, an
* application must specify one or more most-trusted CAs 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
- * Set of TrustAnchor 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
- * KeyStore instance containing trusted certificate entries, each
+ * {@code KeyStore} instance containing trusted certificate entries, each
* of which will be considered as a most-trusted CA.
*
*
In addition, an application must specify constraints on the target
- * certificate that the CertPathBuilder will attempt
+ * certificate that the {@code CertPathBuilder} will attempt
* to build a path to. The constraints are specified as a
- * CertSelector object. These constraints should provide the
- * CertPathBuilder with enough search criteria to find the target
- * certificate. Minimal criteria for an X509Certificate 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 CertPathBuilder
- * may throw a CertPathBuilderException.
+ * If enough criteria is not specified, the {@code CertPathBuilder}
+ * may throw a {@code CertPathBuilderException}.
*
* Concurrent Access
*
@@ -80,23 +80,23 @@ public class PKIXBuilderParameters extends PKIXParameters {
private int maxPathLength = 5;
/**
- * Creates an instance of PKIXBuilderParameters with
- * the specified Set 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}.
*
- *
Note that the Set is copied to protect against
+ *
Note that the {@code Set} is copied to protect against
* subsequent modifications.
*
- * @param trustAnchors a Set of TrustAnchors
- * @param targetConstraints a CertSelector 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 trustAnchors
- * is empty (trustAnchors.isEmpty() == true)
- * @throws NullPointerException if trustAnchors is
- * null
+ * @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
- * trustAnchors are not of type
- * java.security.cert.TrustAnchor
+ * {@code trustAnchors} are not of type
+ * {@code java.security.cert.TrustAnchor}
*/
public PKIXBuilderParameters(Set trustAnchors, CertSelector
targetConstraints) throws InvalidAlgorithmParameterException
@@ -106,22 +106,22 @@ public class PKIXBuilderParameters extends PKIXParameters {
}
/**
- * Creates an instance of PKIXBuilderParameters that
+ * Creates an instance of {@code PKIXBuilderParameters} that
* populates the set of most-trusted CAs from the trusted
- * certificate entries contained in the specified KeyStore.
- * Only keystore entries that contain trusted X509Certificates
+ * 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 KeyStore from which the set of
+ * @param keystore a {@code KeyStore} from which the set of
* most-trusted CAs will be populated
- * @param targetConstraints a CertSelector specifying the
+ * @param targetConstraints a {@code CertSelector} specifying the
* constraints on the target certificate
- * @throws KeyStoreException if keystore has not been
+ * @throws KeyStoreException if {@code keystore} has not been
* initialized
- * @throws InvalidAlgorithmParameterException if keystore does
+ * @throws InvalidAlgorithmParameterException if {@code keystore} does
* not contain at least one trusted certificate entry
- * @throws NullPointerException if keystore is
- * null
+ * @throws NullPointerException if {@code keystore} is
+ * {@code null}
*/
public PKIXBuilderParameters(KeyStore keystore,
CertSelector targetConstraints)
@@ -139,7 +139,7 @@ public class PKIXBuilderParameters extends PKIXParameters {
* 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
- * CertPathBuilder instance must not build
+ * {@code CertPathBuilder} instance must not build
* paths longer than the length specified.
*
*
A value of 0 implies that the path can only contain
@@ -149,14 +149,14 @@ public class PKIXBuilderParameters extends PKIXParameters {
* Setting a value less than -1 will cause an exception to be thrown.
*
*
If any of the CA certificates contain the
- * BasicConstraintsExtension, the value of the
- * pathLenConstraint 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 maxPathLength is set
+ * @throws InvalidParameterException if {@code maxPathLength} is set
* to a value less than -1
*
* @see #getMaxPathLength
diff --git a/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java b/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java
index d5efbb35ad226f04acdc9861237219fd9b0e2e1e..3255a3bbda6e45f09b08c5aea2ca8bc7453f5f37 100644
--- a/src/share/classes/java/security/cert/PKIXCertPathBuilderResult.java
+++ b/src/share/classes/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 @@ import java.security.PublicKey;
* returned using this algorithm are also validated according to the PKIX
* certification path validation algorithm.
*
- *
Instances of PKIXCertPathBuilderResult are returned by
- * the build method of CertPathBuilder
+ *
Instances of {@code PKIXCertPathBuilderResult} are returned by
+ * the {@code build} method of {@code CertPathBuilder}
* objects implementing the PKIX algorithm.
*
- *
All PKIXCertPathBuilderResult objects contain the
+ *
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 TrustAnchor describing the certification
+ * algorithm, and a {@code TrustAnchor} describing the certification
* authority (CA) that served as a trust anchor for the certification path.
*
* Concurrent Access
@@ -62,18 +62,18 @@ public class PKIXCertPathBuilderResult extends PKIXCertPathValidatorResult
private CertPath certPath;
/**
- * Creates an instance of PKIXCertPathBuilderResult
+ * Creates an instance of {@code PKIXCertPathBuilderResult}
* containing the specified parameters.
*
- * @param certPath the validated CertPath
- * @param trustAnchor a TrustAnchor 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 null
+ * @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 certPath,
- * trustAnchor or subjectPublicKey parameters
- * are null
+ * @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 @@ public class PKIXCertPathBuilderResult extends PKIXCertPathValidatorResult
/**
* Returns the built and validated certification path. The
- * CertPath 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 TrustAnchor 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 CertPath (never
- * null)
+ * @return the built and validated {@code CertPath} (never
+ * {@code null})
*/
public CertPath getCertPath() {
return certPath;
@@ -101,10 +101,10 @@ public class PKIXCertPathBuilderResult extends PKIXCertPathValidatorResult
/**
* Return a printable representation of this
- * PKIXCertPathBuilderResult.
+ * {@code PKIXCertPathBuilderResult}.
*
- * @return a String describing the contents of this
- * PKIXCertPathBuilderResult
+ * @return a {@code String} describing the contents of this
+ * {@code PKIXCertPathBuilderResult}
*/
public String toString() {
StringBuffer sb = new StringBuffer();
diff --git a/src/share/classes/java/security/cert/PKIXCertPathChecker.java b/src/share/classes/java/security/cert/PKIXCertPathChecker.java
index 30b44c37f74d6603dbe52e4cad68b248b43bfdc1..21e01bf5166e5afb9fee9faa083a36965c81c9d9 100644
--- a/src/share/classes/java/security/cert/PKIXCertPathChecker.java
+++ b/src/share/classes/java/security/cert/PKIXCertPathChecker.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2012, 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,38 +30,38 @@ import java.util.Set;
/**
* An abstract class that performs one or more checks on an
- * X509Certificate.
+ * {@code X509Certificate}.
*
- *
A concrete implementation of the PKIXCertPathChecker class
+ *
A concrete implementation of the {@code PKIXCertPathChecker} class
* can be created to extend the PKIX certification path validation algorithm.
* For example, an implementation may check for and process a critical private
* extension of each certificate in a certification path.
*
- *
Instances of PKIXCertPathChecker are passed as parameters
+ *
Instances of {@code PKIXCertPathChecker} are passed as parameters
* using the {@link PKIXParameters#setCertPathCheckers setCertPathCheckers}
* or {@link PKIXParameters#addCertPathChecker addCertPathChecker} methods
- * of the PKIXParameters and PKIXBuilderParameters
- * class. Each of the PKIXCertPathCheckers {@link #check check}
+ * of the {@code PKIXParameters} and {@code PKIXBuilderParameters}
+ * class. Each of the {@code PKIXCertPathChecker}s {@link #check check}
* methods will be called, in turn, for each certificate processed by a PKIX
- * CertPathValidator or CertPathBuilder
+ * {@code CertPathValidator} or {@code CertPathBuilder}
* implementation.
*
- *
A PKIXCertPathChecker may be called multiple times on
+ *
A {@code PKIXCertPathChecker} may be called multiple times on
* successive certificates in a certification path. Concrete subclasses
* are expected to maintain any internal state that may be necessary to
* check successive certificates. The {@link #init init} method is used
* to initialize the internal state of the checker so that the certificates
* of a new certification path may be checked. A stateful implementation
* must override the {@link #clone clone} method if necessary in
- * order to allow a PKIX CertPathBuilder to efficiently
+ * order to allow a PKIX {@code CertPathBuilder} to efficiently
* backtrack and try other paths. In these situations, the
- * CertPathBuilder is able to restore prior path validation
- * states by restoring the cloned PKIXCertPathCheckers.
+ * {@code CertPathBuilder} is able to restore prior path validation
+ * states by restoring the cloned {@code PKIXCertPathChecker}s.
*
*
The order in which the certificates are presented to the
- * PKIXCertPathChecker may be either in the forward direction
+ * {@code PKIXCertPathChecker} may be either in the forward direction
* (from target to most-trusted CA) or in the reverse direction (from
- * most-trusted CA to target). A PKIXCertPathChecker implementation
+ * most-trusted CA to target). A {@code PKIXCertPathChecker} implementation
* must support reverse checking (the ability to perform its checks when
* it is presented with certificates in the reverse direction) and may
* support forward checking (the ability to perform its checks when it is
@@ -96,19 +96,19 @@ public abstract class PKIXCertPathChecker
protected PKIXCertPathChecker() {}
/**
- * Initializes the internal state of this PKIXCertPathChecker.
+ * Initializes the internal state of this {@code PKIXCertPathChecker}.
*
- * The forward flag specifies the order that
+ * The {@code forward} flag specifies the order that
* certificates will be passed to the {@link #check check} method
- * (forward or reverse). A PKIXCertPathCheckermust
+ * (forward or reverse). A {@code PKIXCertPathChecker} must
* support reverse checking and may support forward checking.
*
* @param forward the order that certificates are presented to
- * the check method. If true, certificates
+ * the {@code check} method. If {@code true}, certificates
* are presented from target to most-trusted CA (forward); if
- * false, from most-trusted CA to target (reverse).
+ * {@code false}, from most-trusted CA to target (reverse).
* @throws CertPathValidatorException if this
- * PKIXCertPathChecker is unable to check certificates in
+ * {@code PKIXCertPathChecker} is unable to check certificates in
* the specified order; it should never be thrown if the forward flag
* is false since reverse checking must be supported
*/
@@ -118,32 +118,32 @@ public abstract class PKIXCertPathChecker
/**
* Indicates if forward checking is supported. Forward checking refers
- * to the ability of the PKIXCertPathChecker to perform
- * its checks when certificates are presented to the check
+ * to the ability of the {@code PKIXCertPathChecker} to perform
+ * its checks when certificates are presented to the {@code check}
* method in the forward direction (from target to most-trusted CA).
*
- * @return true if forward checking is supported,
- * false otherwise
+ * @return {@code true} if forward checking is supported,
+ * {@code false} otherwise
*/
@Override
public abstract boolean isForwardCheckingSupported();
/**
- * Returns an immutable Set of X.509 certificate extensions
- * that this PKIXCertPathChecker supports (i.e. recognizes, is
- * able to process), or null if no extensions are supported.
+ * Returns an immutable {@code Set} of X.509 certificate extensions
+ * that this {@code PKIXCertPathChecker} supports (i.e. recognizes, is
+ * able to process), or {@code null} if no extensions are supported.
*
- * Each element of the set is a String representing the
+ * Each element of the set is a {@code String} representing the
* Object Identifier (OID) of the X.509 extension that is supported.
* The OID is represented by a set of nonnegative integers separated by
* periods.
*
- * All X.509 certificate extensions that a PKIXCertPathChecker
+ * All X.509 certificate extensions that a {@code PKIXCertPathChecker}
* might possibly be able to process should be included in the set.
*
- * @return an immutable Set of X.509 extension OIDs (in
- * String format) supported by this
- * PKIXCertPathChecker, or null if no
+ * @return an immutable {@code Set} of X.509 extension OIDs (in
+ * {@code String} format) supported by this
+ * {@code PKIXCertPathChecker}, or {@code null} if no
* extensions are supported
*/
public abstract Set getSupportedExtensions();
@@ -153,10 +153,10 @@ public abstract class PKIXCertPathChecker
* state and removes any critical extensions that it processes from the
* specified collection of OID strings that represent the unresolved
* critical extensions. The certificates are presented in the order
- * specified by the init method.
+ * specified by the {@code init} method.
*
- * @param cert the Certificate to be checked
- * @param unresolvedCritExts a Collection of OID strings
+ * @param cert the {@code Certificate} to be checked
+ * @param unresolvedCritExts a {@code Collection} of OID strings
* representing the current set of unresolved critical extensions
* @exception CertPathValidatorException if the specified certificate does
* not pass the check
@@ -177,12 +177,12 @@ public abstract class PKIXCertPathChecker
}
/**
- * Returns a clone of this object. Calls the Object.clone()
+ * Returns a clone of this object. Calls the {@code Object.clone()}
* method.
* All subclasses which maintain state must support and
* override this method, if necessary.
*
- * @return a copy of this PKIXCertPathChecker
+ * @return a copy of this {@code PKIXCertPathChecker}
*/
@Override
public Object clone() {
diff --git a/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java b/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java
index 39f2272681857d92b2358ecaabd0424b150927bb..b40cd393c7dc691f4fc2e65282b635d164088750 100644
--- a/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.java
+++ b/src/share/classes/java/security/cert/PKIXCertPathValidatorResult.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
@@ -31,13 +31,13 @@ import java.security.PublicKey;
* This class represents the successful result of the PKIX certification
* path validation algorithm.
*
- *
Instances of PKIXCertPathValidatorResult are returned by the
+ *
Instances of {@code PKIXCertPathValidatorResult} are returned by the
* {@link CertPathValidator#validate validate} method of
- * CertPathValidator objects implementing the PKIX algorithm.
+ * {@code CertPathValidator} objects implementing the PKIX algorithm.
*
- *
All PKIXCertPathValidatorResult objects contain the
+ *
All {@code PKIXCertPathValidatorResult} objects contain the
* valid policy tree and subject public key resulting from the
- * validation algorithm, as well as a TrustAnchor describing
+ * validation algorithm, as well as a {@code TrustAnchor} describing
* the certification authority (CA) that served as a trust anchor for the
* certification path.
*
@@ -62,16 +62,16 @@ public class PKIXCertPathValidatorResult implements CertPathValidatorResult {
private PublicKey subjectPublicKey;
/**
- * Creates an instance of PKIXCertPathValidatorResult
+ * Creates an instance of {@code PKIXCertPathValidatorResult}
* containing the specified parameters.
*
- * @param trustAnchor a TrustAnchor 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 null
+ * @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 subjectPublicKey or
- * trustAnchor parameters are null
+ * @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 @@ public class PKIXCertPathValidatorResult implements CertPathValidatorResult {
}
/**
- * Returns the TrustAnchor describing the CA that served
+ * Returns the {@code TrustAnchor} describing the CA that served
* as a trust anchor for the certification path.
*
- * @return the TrustAnchor (never null)
+ * @return the {@code TrustAnchor} (never {@code null})
*/
public TrustAnchor getTrustAnchor() {
return trustAnchor;
@@ -98,18 +98,18 @@ public class PKIXCertPathValidatorResult implements CertPathValidatorResult {
/**
* Returns the root node of the valid policy tree resulting from the
* PKIX certification path validation algorithm. The
- * PolicyNode 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.
*
*
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 PKIXParameters. 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 null
+ * @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 @@ public class PKIXCertPathValidatorResult implements CertPathValidatorResult {
* 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 null)
+ * @return the public key of the subject (never {@code null})
*/
public PublicKey getPublicKey() {
return subjectPublicKey;
@@ -142,10 +142,10 @@ public class PKIXCertPathValidatorResult implements CertPathValidatorResult {
/**
* Return a printable representation of this
- * PKIXCertPathValidatorResult.
+ * {@code PKIXCertPathValidatorResult}.
*
- * @return a String describing the contents of this
- * PKIXCertPathValidatorResult
+ * @return a {@code String} describing the contents of this
+ * {@code PKIXCertPathValidatorResult}
*/
public String toString() {
StringBuffer sb = new StringBuffer();
diff --git a/src/share/classes/java/security/cert/PKIXParameters.java b/src/share/classes/java/security/cert/PKIXParameters.java
index 8b0100511e0bca41386949effe2adbfbcdd353bc..4d8a344532e970526bffec8f65d3c7645ae98f09 100644
--- a/src/share/classes/java/security/cert/PKIXParameters.java
+++ b/src/share/classes/java/security/cert/PKIXParameters.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,34 +38,34 @@ import java.util.List;
import java.util.Set;
/**
- * Parameters used as input for the PKIX CertPathValidator
+ * Parameters used as input for the PKIX {@code CertPathValidator}
* algorithm.
*
- * A PKIX CertPathValidator uses these parameters to
- * validate a CertPath 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.
*
- *
To instantiate a PKIXParameters object, an
+ *
To instantiate a {@code PKIXParameters} object, an
* application must specify one or more most-trusted CAs 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 Set of TrustAnchor 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
- * KeyStore instance containing trusted certificate entries, each
+ * {@code KeyStore} instance containing trusted certificate entries, each
* of which will be considered as a most-trusted CA.
*
- * Once a PKIXParameters 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
- * PKIXParameters is passed along with the CertPath
+ * {@code PKIXParameters} is passed along with the {@code CertPath}
* to be validated to {@link CertPathValidator#validate
* CertPathValidator.validate}.
*
- * Any parameter that is not set (or is set to null) 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
- * date parameter is null, 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.
*
@@ -99,20 +99,20 @@ public class PKIXParameters implements CertPathParameters {
private CertSelector certSelector;
/**
- * Creates an instance of PKIXParameters with the specified
- * Set 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}.
*
- * Note that the Set is copied to protect against
+ * Note that the {@code Set} is copied to protect against
* subsequent modifications.
*
- * @param trustAnchors a Set of TrustAnchors
+ * @param trustAnchors a {@code Set} of {@code TrustAnchor}s
* @throws InvalidAlgorithmParameterException if the specified
- * Set is empty (trustAnchors.isEmpty() == true)
- * @throws NullPointerException if the specified Set is
- * null
- * @throws ClassCastException if any of the elements in the Set
- * are not of type java.security.cert.TrustAnchor
+ * {@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 trustAnchors)
throws InvalidAlgorithmParameterException
@@ -125,18 +125,18 @@ public class PKIXParameters implements CertPathParameters {
}
/**
- * Creates an instance of PKIXParameters that
+ * Creates an instance of {@code PKIXParameters} that
* populates the set of most-trusted CAs from the trusted
- * certificate entries contained in the specified KeyStore.
- * Only keystore entries that contain trusted X509Certificates
+ * 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 KeyStore 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 null
+ * @throws NullPointerException if the keystore is {@code null}
*/
public PKIXParameters(KeyStore keystore)
throws KeyStoreException, InvalidAlgorithmParameterException
@@ -161,11 +161,11 @@ public class PKIXParameters implements CertPathParameters {
}
/**
- * Returns an immutable Set of the most-trusted
+ * Returns an immutable {@code Set} of the most-trusted
* CAs.
*
- * @return an immutable Set of TrustAnchors
- * (never null)
+ * @return an immutable {@code Set} of {@code TrustAnchor}s
+ * (never {@code null})
*
* @see #setTrustAnchors
*/
@@ -174,18 +174,18 @@ public class PKIXParameters implements CertPathParameters {
}
/**
- * Sets the Set of most-trusted CAs.
+ * Sets the {@code Set} of most-trusted CAs.
*
- * Note that the Set is copied to protect against
+ * Note that the {@code Set} is copied to protect against
* subsequent modifications.
*
- * @param trustAnchors a Set of TrustAnchors
+ * @param trustAnchors a {@code Set} of {@code TrustAnchor}s
* @throws InvalidAlgorithmParameterException if the specified
- * Set is empty (trustAnchors.isEmpty() == true)
- * @throws NullPointerException if the specified Set is
- * null
+ * {@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 java.security.cert.TrustAnchor
+ * are not of type {@code java.security.cert.TrustAnchor}
*
* @see #getTrustAnchors
*/
@@ -211,16 +211,16 @@ public class PKIXParameters implements CertPathParameters {
}
/**
- * Returns an immutable Set 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
- * Set, 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 Set of initial policy OIDs in
- * String format, or an empty Set (implying any
- * policy is acceptable). Never returns null.
+ * @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 @@ public class PKIXParameters implements CertPathParameters {
}
/**
- * Sets the Set 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 Set (or null).
+ * with an empty {@code Set} (or {@code null}).
*
- * Note that the Set is copied to protect against
+ * Note that the {@code Set} is copied to protect against
* subsequent modifications.
*
- * @param initialPolicies a Set of initial policy
- * OIDs in String format (or null)
+ * @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 String
+ * not of type {@code String}
*
* @see #getInitialPolicies
*/
@@ -262,19 +262,19 @@ public class PKIXParameters implements CertPathParameters {
}
/**
- * Sets the list of CertStores to be used in finding
- * certificates and CRLs. May be null, in which case
- * no CertStores will be used. The first
- * CertStores 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.
*
- * Note that the List is copied to protect against
+ * Note that the {@code List} is copied to protect against
* subsequent modifications.
*
- * @param stores a List of CertStores (or
- * null)
+ * @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 java.security.cert.CertStore
+ * not of type {@code java.security.cert.CertStore}
*
* @see #getCertStores
*/
@@ -293,10 +293,10 @@ public class PKIXParameters implements CertPathParameters {
}
/**
- * Adds a CertStore to the end of the list of
- * CertStores 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 CertStore to add. If null,
+ * @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 @@ public class PKIXParameters implements CertPathParameters {
}
/**
- * Returns an immutable List of CertStores that
+ * Returns an immutable {@code List} of {@code CertStore}s that
* are used to find certificates and CRLs.
*
- * @return an immutable List of CertStores
- * (may be empty, but never null)
+ * @return an immutable {@code List} of {@code CertStore}s
+ * (may be empty, but never {@code null})
*
* @see #setCertStores
*/
@@ -325,7 +325,7 @@ public class PKIXParameters implements CertPathParameters {
* will be used. If this flag is false, the default revocation checking
* mechanism will be disabled (not used).
*
- * When a PKIXParameters 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 @@ public class PKIXParameters implements CertPathParameters {
* acceptable policy needs to be explicitly identified in every certificate.
* By default, the ExplicitPolicyRequired flag is false.
*
- * @param val true if explicit policy is to be required,
- * false 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 @@ public class PKIXParameters implements CertPathParameters {
* acceptable policy needs to be explicitly identified in every certificate.
* By default, the ExplicitPolicyRequired flag is false.
*
- * @return true if explicit policy is required,
- * false otherwise
+ * @return {@code true} if explicit policy is required,
+ * {@code false} otherwise
*/
public boolean isExplicitPolicyRequired() {
return explicitPolicyRequired;
@@ -384,8 +384,8 @@ public class PKIXParameters implements CertPathParameters {
* mapping is inhibited. By default, policy mapping is not inhibited (the
* flag is false).
*
- * @param val true if policy mapping is to be inhibited,
- * false 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 @@ public class PKIXParameters implements CertPathParameters {
* 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 false).
+ * returns {@code false}).
*
- * @param val true if the any policy OID is to be
- * inhibited, false 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 @@ public class PKIXParameters implements CertPathParameters {
* Checks whether the any policy OID should be processed if it
* is included in a certificate.
*
- * @return true if the any policy OID is inhibited,
- * false otherwise
+ * @return {@code true} if the any policy OID is inhibited,
+ * {@code false} otherwise
*/
public boolean isAnyPolicyInhibited() {
return anyPolicyInhibited;
@@ -432,7 +432,7 @@ public class PKIXParameters implements CertPathParameters {
* policies extension that is marked critical are rejected.
* If the flag is false, certificates are not rejected on this basis.
*
- *
When a PKIXParameters object is created, this flag is
+ *
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 @@ public class PKIXParameters implements CertPathParameters {
* extension that is marked critical are rejected.
* If the flag is false, certificates are not rejected on this basis.
*
- *
When a PKIXParameters object is created, this flag is
+ *
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 @@ public class PKIXParameters implements CertPathParameters {
/**
* Returns the time for which the validity of the certification path
- * should be determined. If null, the current time is used.
+ * should be determined. If {@code null}, the current time is used.
*
- * Note that the Date returned is copied to protect against
+ * Note that the {@code Date} returned is copied to protect against
* subsequent modifications.
*
- * @return the Date, or null if not set
+ * @return the {@code Date}, or {@code null} if not set
* @see #setDate
*/
public Date getDate() {
@@ -490,12 +490,12 @@ public class PKIXParameters implements CertPathParameters {
/**
* Sets the time for which the validity of the certification path
- * should be determined. If null, the current time is used.
+ * should be determined. If {@code null}, the current time is used.
*
- * Note that the Date supplied here is copied to protect
+ * Note that the {@code Date} supplied here is copied to protect
* against subsequent modifications.
*
- * @param date the Date, or null for the
+ * @param date the {@code Date}, or {@code null} for the
* current time
* @see #getDate
*/
@@ -507,39 +507,39 @@ public class PKIXParameters implements CertPathParameters {
}
/**
- * Sets a List of additional certification path checkers. If
- * the specified List contains an object that is not a
- * PKIXCertPathChecker, 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.
*
- * Each PKIXCertPathChecker 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 PKIXCertPathChecker should be instantiated with any
+ * Each {@code PKIXCertPathChecker} should be instantiated with any
* initialization parameters needed to execute the check.
*
* This method allows sophisticated applications to extend a PKIX
- * CertPathValidator or CertPathBuilder.
- * Each of the specified PKIXCertPathCheckers will be called,
- * in turn, by a PKIX CertPathValidator or
- * CertPathBuilder 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.
*
- * Regardless of whether these additional PKIXCertPathCheckers
- * are set, a PKIX CertPathValidator or
- * CertPathBuilder 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).
*
- * Note that the List supplied here is copied and each
- * PKIXCertPathChecker 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 List of PKIXCertPathCheckers.
- * May be null, 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 java.security.cert.PKIXCertPathChecker
+ * are not of type {@code java.security.cert.PKIXCertPathChecker}
* @see #getCertPathCheckers
*/
public void setCertPathCheckers(List checkers) {
@@ -556,14 +556,14 @@ public class PKIXParameters implements CertPathParameters {
}
/**
- * Returns the List of certification path checkers.
- * The returned List is immutable, and each
- * PKIXCertPathChecker in the List 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 List of
- * PKIXCertPathCheckers (may be empty, but not
- * null)
+ * @return an immutable {@code List} of
+ * {@code PKIXCertPathChecker}s (may be empty, but not
+ * {@code null})
* @see #setCertPathCheckers
*/
public List getCertPathCheckers() {
@@ -575,15 +575,15 @@ public class PKIXParameters implements CertPathParameters {
}
/**
- * Adds a PKIXCertPathChecker 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.
*
- * Note that the PKIXCertPathChecker is cloned to protect
+ * Note that the {@code PKIXCertPathChecker} is cloned to protect
* against subsequent modifications.
*
- * @param checker a PKIXCertPathChecker to add to the list of
- * checks. If null, 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 @@ public class PKIXParameters implements CertPathParameters {
}
/**
- * Returns the signature provider's name, or null
+ * Returns the signature provider's name, or {@code null}
* if not set.
*
- * @return the signature provider's name (or null)
+ * @return the signature provider's name (or {@code null})
* @see #setSigProvider
*/
public String getSigProvider() {
@@ -605,10 +605,10 @@ public class PKIXParameters implements CertPathParameters {
/**
* Sets the signature provider's name. The specified provider will be
* preferred when creating {@link java.security.Signature Signature}
- * objects. If null 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 null)
+ * @param sigProvider the signature provider's name (or {@code null})
* @see #getSigProvider
*/
public void setSigProvider(String sigProvider) {
@@ -617,14 +617,14 @@ public class PKIXParameters implements CertPathParameters {
/**
* Returns the required constraints on the target certificate.
- * The constraints are returned as an instance of CertSelector.
- * If null, no constraints are defined.
+ * The constraints are returned as an instance of {@code CertSelector}.
+ * If {@code null}, no constraints are defined.
*
- *
Note that the CertSelector returned is cloned
+ *
Note that the {@code CertSelector} returned is cloned
* to protect against subsequent modifications.
*
- * @return a CertSelector specifying the constraints
- * on the target certificate (or null)
+ * @return a {@code CertSelector} specifying the constraints
+ * on the target certificate (or {@code null})
* @see #setTargetCertConstraints
*/
public CertSelector getTargetCertConstraints() {
@@ -638,14 +638,14 @@ public class PKIXParameters implements CertPathParameters {
/**
* Sets the required constraints on the target certificate.
* The constraints are specified as an instance of
- * CertSelector. If null, no constraints are
+ * {@code CertSelector}. If {@code null}, no constraints are
* defined.
*
- *
Note that the CertSelector specified is cloned
+ *
Note that the {@code CertSelector} specified is cloned
* to protect against subsequent modifications.
*
- * @param selector a CertSelector specifying the constraints
- * on the target certificate (or null)
+ * @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 @@ public class PKIXParameters implements CertPathParameters {
}
/**
- * Makes a copy of this PKIXParameters 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 PKIXParameters object
+ * @return a copy of this {@code PKIXParameters} object
*/
public Object clone() {
try {
diff --git a/src/share/classes/java/security/cert/PKIXReason.java b/src/share/classes/java/security/cert/PKIXReason.java
index 9d81b1321048e5aed7341aa679def6b310c61130..d58ded97541b43c5689b733bcf3b3d7ce4389a4c 100644
--- a/src/share/classes/java/security/cert/PKIXReason.java
+++ b/src/share/classes/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 PKIXReason 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
- * CertPathValidatorException.BasicReason enumeration.
+ * {@code CertPathValidatorException.BasicReason} enumeration.
*
* @since 1.7
*/
diff --git a/src/share/classes/java/security/cert/PolicyNode.java b/src/share/classes/java/security/cert/PolicyNode.java
index 7b16dfe8fbf11bf5d98060e817f4383f647e230c..1633dcb83dafea80078ccbb04b5059bdbc1c71f2 100644
--- a/src/share/classes/java/security/cert/PolicyNode.java
+++ b/src/share/classes/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 @@ import java.util.Set;
*
*
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 PKIXParameters. 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 @@ import java.util.Set;
* 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
- * PolicyNode.
+ * {@code PolicyNode}.
*
*
Concurrent Access
- *
All PolicyNode objects must be immutable and
+ *
All {@code PolicyNode} objects must be immutable and
* thread-safe. Multiple threads may concurrently invoke the methods defined
- * in this class on a single PolicyNode 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 @@ import java.util.Set;
public interface PolicyNode {
/**
- * Returns the parent of this node, or null 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 null 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 @@ public interface PolicyNode {
/**
* Returns an iterator over the children of this node. Any attempts to
* modify the children of this node through the
- * Iterator's remove method must throw an
- * UnsupportedOperationException.
+ * {@code Iterator}'s remove method must throw an
+ * {@code UnsupportedOperationException}.
*
* @return an iterator over the children of this node
*/
@@ -94,7 +94,7 @@ public interface PolicyNode {
/**
* Returns the valid policy represented by this node.
*
- * @return the String 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 @@ public interface PolicyNode {
* Returns the set of policy qualifiers associated with the
* valid policy represented by this node.
*
- * @return an immutable Set of
- * PolicyQualifierInfos. For the root node, this
- * is always an empty Set.
+ * @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 @@ public interface PolicyNode {
* Returns the set of expected policies that would satisfy this
* node's valid policy in the next certificate to be processed.
*
- * @return an immutable Set of expected policy
- * String OIDs. For the root node, this method
- * always returns a Set 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 getExpectedPolicies();
@@ -125,8 +125,8 @@ public interface PolicyNode {
* Returns the criticality indicator of the certificate policy extension
* in the most recently processed certificate.
*
- * @return true if extension marked critical,
- * false otherwise. For the root node, false
+ * @return {@code true} if extension marked critical,
+ * {@code false} otherwise. For the root node, {@code false}
* is always returned.
*/
boolean isCritical();
diff --git a/src/share/classes/java/security/cert/PolicyQualifierInfo.java b/src/share/classes/java/security/cert/PolicyQualifierInfo.java
index 75a8702ac8438bd520156fd8f2729272c4535c47..bc083eb7a43c7377a1ee29faf2fb316c42190b5f 100644
--- a/src/share/classes/java/security/cert/PolicyQualifierInfo.java
+++ b/src/share/classes/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
@@ -50,12 +50,12 @@ import sun.security.util.DerValue;
* policy information terms limit the set of policies for certification paths
* which include this certificate.
*
- * A Set of PolicyQualifierInfo 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
- * policyQualifiersRejected 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 @@ import sun.security.util.DerValue;
* 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
- * policyQualifiersRejected 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.
*
*
Concurrent Access
*
- *
All PolicyQualifierInfo objects must be immutable and
+ *
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 PolicyQualifierInfo
+ * methods defined in this class on a single {@code PolicyQualifierInfo}
* object (or more than one) with no ill effects. Requiring
- * PolicyQualifierInfo 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 @@ public class PolicyQualifierInfo {
private String pqiString;
/**
- * Creates an instance of PolicyQualifierInfo 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 @@ public class PolicyQualifierInfo {
}
/**
- * Returns the policyQualifierId field of this
- * PolicyQualifierInfo. The policyQualifierId
+ * 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 null)
+ * @return the OID (never {@code null})
*/
public final String getPolicyQualifierId() {
return mId;
@@ -128,9 +128,9 @@ public class PolicyQualifierInfo {
/**
* Returns the ASN.1 DER encoded form of this
- * PolicyQualifierInfo.
+ * {@code PolicyQualifierInfo}.
*
- * @return the ASN.1 DER encoded bytes (never null).
+ * @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 @@ public class PolicyQualifierInfo {
}
/**
- * Returns the ASN.1 DER encoded form of the qualifier
- * field of this PolicyQualifierInfo.
+ * 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 qualifier
+ * @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 @@ public class PolicyQualifierInfo {
/**
* Return a printable representation of this
- * PolicyQualifierInfo.
+ * {@code PolicyQualifierInfo}.
*
- * @return a String describing the contents of this
- * PolicyQualifierInfo
+ * @return a {@code String} describing the contents of this
+ * {@code PolicyQualifierInfo}
*/
public String toString() {
if (pqiString != null)
diff --git a/src/share/classes/java/security/cert/TrustAnchor.java b/src/share/classes/java/security/cert/TrustAnchor.java
index d9c88f405dcf4f36bc5913b8320637754117409f..fe267a52f669bf33d9a81cb53ec410ea657e31b1 100644
--- a/src/share/classes/java/security/cert/TrustAnchor.java
+++ b/src/share/classes/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,16 @@ import sun.security.x509.X500Name;
* 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 X509Certificate or as
+ * specified in the form of a trusted {@code X509Certificate} or as
* individual parameters.
*
* Concurrent Access
*
- *
All TrustAnchor objects must be immutable and
+ *
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 TrustAnchor
+ * methods defined in this class on a single {@code TrustAnchor}
* object (or more than one) with no ill effects. Requiring
- * TrustAnchor 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 +71,8 @@ public class TrustAnchor {
private NameConstraintsExtension nc;
/**
- * Creates an instance of TrustAnchor with the specified
- * X509Certificate 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.
*
@@ -82,7 +82,7 @@ public class TrustAnchor {
* RFC 3280
* and X.509. The ASN.1 definition of this structure appears below.
*
- *
* Note that the name constraints byte array supplied is cloned to protect
* against subsequent modifications.
*
- * @param trustedCert a trusted X509Certificate
+ * @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 null 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
- * X509Certificate is null
+ * {@code X509Certificate} is {@code null}
*/
public TrustAnchor(X509Certificate trustedCert, byte[] nameConstraints)
{
@@ -134,7 +134,7 @@ public class TrustAnchor {
}
/**
- * Creates an instance of TrustAnchor 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 +155,9 @@ public class TrustAnchor {
* @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 null to omit the parameter.
- * @throws NullPointerException if the specified caPrincipal or
- * pubKey parameter is null
+ * 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 +173,7 @@ public class TrustAnchor {
}
/**
- * Creates an instance of TrustAnchor 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 +191,17 @@ public class TrustAnchor {
*
* @param caName the X.500 distinguished name of the most-trusted CA in
* RFC 2253
- * String 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 null to omit the parameter.
- * @throws IllegalArgumentException if the specified
- * caName parameter is empty (caName.length() == 0)
+ * 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 caName or
- * pubKey parameter is null
+ * @throws NullPointerException if the specified {@code caName} or
+ * {@code pubKey} parameter is {@code null}
*/
public TrustAnchor(String caName, PublicKey pubKey, byte[] nameConstraints)
{
@@ -225,7 +225,7 @@ public class TrustAnchor {
/**
* Returns the most-trusted CA certificate.
*
- * @return a trusted X509Certificate or null
+ * @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 +236,7 @@ public class TrustAnchor {
* Returns the name of the most-trusted CA as an X500Principal.
*
* @return the X.500 distinguished name of the most-trusted CA, or
- * null 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 +245,11 @@ public class TrustAnchor {
}
/**
- * Returns the name of the most-trusted CA in RFC 2253 String
+ * 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
- * null 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 +259,7 @@ public class TrustAnchor {
/**
* Returns the public key of the most-trusted CA.
*
- * @return the public key of the most-trusted CA, or null
+ * @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 +306,16 @@ public class TrustAnchor {
*
* @return a byte array containing the ASN.1 DER encoding of
* a NameConstraints extension used for checking name constraints,
- * or null 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 TrustAnchor.
+ * Returns a formatted string describing the {@code TrustAnchor}.
*
- * @return a formatted string describing the TrustAnchor
+ * @return a formatted string describing the {@code TrustAnchor}
*/
public String toString() {
StringBuffer sb = new StringBuffer();
diff --git a/src/share/classes/java/security/cert/X509CRL.java b/src/share/classes/java/security/cert/X509CRL.java
index cd1769f07249c7802bff5a18bbd70004e9728dbf..5ce84847fa56d57fd83cf5da015058d8cbfbb7f2 100644
--- a/src/share/classes/java/security/cert/X509CRL.java
+++ b/src/share/classes/java/security/cert/X509CRL.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, 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
@@ -72,7 +72,7 @@ import sun.security.x509.X509CRLImpl;
* RFC 3280: Internet X.509
* Public Key Infrastructure Certificate and CRL Profile.
*
- * The ASN.1 definition of tbsCertList is:
+ * The ASN.1 definition of {@code tbsCertList} is:
*
* TBSCertList ::= SEQUENCE {
* version Version OPTIONAL,
@@ -94,12 +94,12 @@ import sun.security.x509.X509CRLImpl;
*
* CRLs are instantiated using a certificate factory. The following is an
* example of how to instantiate an X.509 CRL:
- *
*
* @author Hemma Prafullchandra
*
@@ -122,8 +122,8 @@ public abstract class X509CRL extends CRL implements X509Extension {
/**
* Compares this CRL for equality with the given
- * object. If the other object is an
- * instanceofX509CRL, then
+ * object. If the {@code other} object is an
+ * {@code instanceof} {@code X509CRL}, then
* its encoded form is retrieved and compared with the
* encoded form of this CRL.
*
@@ -225,7 +225,7 @@ public abstract class X509CRL extends CRL implements X509Extension {
*
* This method was added to version 1.8 of the Java Platform Standard
* Edition. In order to maintain backwards compatibility with existing
- * service providers, this method is not abstract
+ * service providers, this method is not {@code abstract}
* and it provides a default implementation.
*
* @param key the PublicKey used to carry out the verification.
@@ -245,11 +245,12 @@ public abstract class X509CRL extends CRL implements X509Extension {
}
/**
- * Gets the version (version number) value from the CRL.
+ * Gets the {@code version} (version number) value from the CRL.
* The ASN.1 definition for this is:
*
* version Version OPTIONAL,
- * -- if present, must be v2
+ * -- if present, must be v2
+ *
* Version ::= INTEGER { v1(0), v2(1), v3(2) }
* -- v3 does not apply to CRLs but appears for consistency
* -- with definition of Version for certs
@@ -261,12 +262,12 @@ public abstract class X509CRL extends CRL implements X509Extension {
/**
* Denigrated, replaced by {@linkplain
- * #getIssuerX500Principal()}. This method returns the issuer
+ * #getIssuerX500Principal()}. This method returns the {@code issuer}
* as an implementation specific Principal object, which should not be
* relied upon by portable code.
*
*
- * Gets the issuer (issuer distinguished name) value from
+ * Gets the {@code issuer} (issuer distinguished name) value from
* the CRL. The issuer name identifies the entity that signed (and
* issued) the CRL.
*
@@ -287,14 +288,14 @@ public abstract class X509CRL extends CRL implements X509Extension {
* AttributeType ::= OBJECT IDENTIFIER
* AttributeValue ::= ANY
*
- * The Name describes a hierarchical name composed of
+ * The {@code Name} describes a hierarchical name composed of
* attributes,
* such as country name, and corresponding values, such as US.
- * The type of the AttributeValue component is determined by
- * the AttributeType; in general it will be a
- * directoryString. A directoryString is usually
- * one of PrintableString,
- * TeletexString or UniversalString.
+ * The type of the {@code AttributeValue} component is determined by
+ * the {@code AttributeType}; in general it will be a
+ * {@code directoryString}. A {@code directoryString} is usually
+ * one of {@code PrintableString},
+ * {@code TeletexString} or {@code UniversalString}.
*
* @return a Principal whose name is the issuer distinguished name.
*/
@@ -302,11 +303,11 @@ public abstract class X509CRL extends CRL implements X509Extension {
/**
* Returns the issuer (issuer distinguished name) value from the
- * CRL as an X500Principal.
+ * CRL as an {@code X500Principal}.
*
* It is recommended that subclasses override this method.
*
- * @return an X500Principal representing the issuer
+ * @return an {@code X500Principal} representing the issuer
* distinguished name
* @since 1.4
*/
@@ -318,7 +319,7 @@ public abstract class X509CRL extends CRL implements X509Extension {
}
/**
- * Gets the thisUpdate date from the CRL.
+ * Gets the {@code thisUpdate} date from the CRL.
* The ASN.1 definition for this is:
*
*
- * @return the thisUpdate date from the CRL.
+ * @return the {@code thisUpdate} date from the CRL.
*/
public abstract Date getThisUpdate();
/**
- * Gets the nextUpdate date from the CRL.
+ * Gets the {@code nextUpdate} date from the CRL.
*
- * @return the nextUpdate date from the CRL, or null if
+ * @return the {@code nextUpdate} date from the CRL, or null if
* not present.
*/
public abstract Date getNextUpdate();
@@ -388,7 +389,7 @@ public abstract class X509CRL extends CRL implements X509Extension {
/**
* Gets the DER-encoded CRL information, the
- * tbsCertList from this CRL.
+ * {@code tbsCertList} from this CRL.
* This can be used to verify the signature independently.
*
* @return the DER-encoded CRL information.
@@ -397,7 +398,7 @@ public abstract class X509CRL extends CRL implements X509Extension {
public abstract byte[] getTBSCertList() throws CRLException;
/**
- * Gets the signature value (the raw signature bits) from
+ * Gets the {@code signature} value (the raw signature bits) from
* the CRL.
* The ASN.1 definition for this is:
*
@@ -413,7 +414,8 @@ public abstract class X509CRL extends CRL implements X509Extension {
* signature algorithm. An example is the string "SHA256withRSA".
* The ASN.1 definition for this is:
*
- * signatureAlgorithm AlgorithmIdentifier
+ * signatureAlgorithm AlgorithmIdentifier
+ *
* AlgorithmIdentifier ::= SEQUENCE {
* algorithm OBJECT IDENTIFIER,
* parameters ANY DEFINED BY algorithm OPTIONAL }
@@ -422,7 +424,7 @@ public abstract class X509CRL extends CRL implements X509Extension {
* -- algorithm object identifier value
*
*
- *
The algorithm name is determined from the algorithm
+ *
The algorithm name is determined from the {@code algorithm}
* OID string.
*
* @return the signature algorithm name.
diff --git a/src/share/classes/java/security/cert/X509CRLEntry.java b/src/share/classes/java/security/cert/X509CRLEntry.java
index 517bbd2c03d2abe99f1d0a17216461f7bd865270..268fa81958701309c17d2c33b1a95dfe83fcce25 100644
--- a/src/share/classes/java/security/cert/X509CRLEntry.java
+++ b/src/share/classes/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 @@ import sun.security.x509.X509CRLEntryImpl;
* crlEntryExtensions Extensions OPTIONAL
* -- if present, must be v2
* } OPTIONAL
- *
+ *
* Extension ::= SEQUENCE {
* extnId OBJECT IDENTIFIER,
* critical BOOLEAN DEFAULT FALSE,
@@ -68,8 +68,8 @@ public abstract class X509CRLEntry implements X509Extension {
/**
* Compares this CRL entry for equality with the given
- * object. If the other object is an
- * instanceofX509CRLEntry, 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 @@ public abstract class X509CRLEntry implements X509Extension {
* in the Reason Code extension of this CRL entry.
*
* @return the reason the certificate has been revoked, or
- * null 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/src/share/classes/java/security/cert/X509CRLSelector.java b/src/share/classes/java/security/cert/X509CRLSelector.java
index 4258da396391629908e49b265b1e4e7aede39176..0580ee36bf280ffa5b936900b1c6d44e3a5847f5 100644
--- a/src/share/classes/java/security/cert/X509CRLSelector.java
+++ b/src/share/classes/java/security/cert/X509CRLSelector.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
@@ -37,18 +37,18 @@ import sun.security.x509.CRLNumberExtension;
import sun.security.x509.X500Name;
/**
- * A CRLSelector that selects X509CRLs that
+ * A {@code CRLSelector} that selects {@code X509CRLs} that
* match all specified criteria. This class is particularly useful when
- * selecting CRLs from a CertStore to check revocation status
+ * selecting CRLs from a {@code CertStore} to check revocation status
* of a particular certificate.
*
- * When first constructed, an X509CRLSelector has no criteria
- * enabled and each of the get methods return a default
- * value (null). Therefore, the {@link #match match} method
- * would return true for any X509CRL. 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
- * X509CRLSelector is passed to
+ * {@code X509CRLSelector} is passed to
* {@link CertStore#getCRLs CertStore.getCRLs} or some similar
* method.
*
@@ -86,35 +86,35 @@ public class X509CRLSelector implements CRLSelector {
private long skew = 0;
/**
- * Creates an X509CRLSelector. Initially, no criteria are set
- * so any X509CRL 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
- * X509CRL must match at least one of the specified
- * distinguished names. If null, 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.
*
* This method allows the caller to specify, with a single method call,
- * the complete set of issuer names which X509CRLs may contain.
+ * the complete set of issuer names which {@code X509CRLs} may contain.
* The specified value replaces the previous value for the issuerNames
* criterion.
*
- * The names parameter (if not null) is a
- * Collection of X500Principals.
+ * The {@code names} parameter (if not {@code null}) is a
+ * {@code Collection} of {@code X500Principal}s.
*
- * Note that the names parameter can contain duplicate
+ * Note that the {@code names} parameter can contain duplicate
* distinguished names, but they may be removed from the
- * Collection of names returned by the
+ * {@code Collection} of names returned by the
* {@link #getIssuers getIssuers} method.
*
- * Note that a copy is performed on the Collection to
+ * Note that a copy is performed on the {@code Collection} to
* protect against subsequent modifications.
*
- * @param issuers a Collection of X500Principals
- * (or null)
+ * @param issuers a {@code Collection} of X500Principals
+ * (or {@code null})
* @see #getIssuers
* @since 1.5
*/
@@ -138,31 +138,31 @@ public class X509CRLSelector implements CRLSelector {
* this method. See {@link #addIssuerName(String)} for more information.
*
* Sets the issuerNames criterion. The issuer distinguished name in the
- * X509CRL must match at least one of the specified
- * distinguished names. If null, 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.
*
* This method allows the caller to specify, with a single method call,
- * the complete set of issuer names which X509CRLs may contain.
+ * the complete set of issuer names which {@code X509CRLs} may contain.
* The specified value replaces the previous value for the issuerNames
* criterion.
*
- * The names parameter (if not null) is a
- * Collection of names. Each name is a String
+ * 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
* RFC 2253 or
- * ASN.1 DER encoded form, respectively). If null 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.
*
- * Note that the names parameter can contain duplicate
+ * Note that the {@code names} parameter can contain duplicate
* distinguished names, but they may be removed from the
- * Collection of names returned by the
+ * {@code Collection} of names returned by the
* {@link #getIssuerNames getIssuerNames} method.
*
* 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.
- *
- * Note that a deep copy is performed on the Collection to
+ * Note that a deep copy is performed on the {@code Collection} to
* protect against subsequent modifications.
*
- * @param names a Collection of names (or null)
+ * @param names a {@code Collection} of names (or {@code null})
* @throws IOException if a parsing error occurs
* @see #getIssuerNames
*/
@@ -208,11 +208,11 @@ public class X509CRLSelector implements CRLSelector {
/**
* Adds a name to the issuerNames criterion. The issuer distinguished
- * name in the X509CRL must match at least one of the specified
+ * name in the {@code X509CRL} must match at least one of the specified
* distinguished names.
*
* This method allows the caller to add a name to the set of issuer names
- * which X509CRLs 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 @@ public class X509CRLSelector implements CRLSelector {
* names.
*
* Adds a name to the issuerNames criterion. The issuer distinguished
- * name in the X509CRL must match at least one of the specified
+ * name in the {@code X509CRL} must match at least one of the specified
* distinguished names.
*
* This method allows the caller to add a name to the set of issuer names
- * which X509CRLs 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 @@ public class X509CRLSelector implements CRLSelector {
/**
* Adds a name to the issuerNames criterion. The issuer distinguished
- * name in the X509CRL must match at least one of the specified
+ * name in the {@code X509CRL} must match at least one of the specified
* distinguished names.
*
* This method allows the caller to add a name to the set of issuer names
- * which X509CRLs 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 @@ public class X509CRLSelector implements CRLSelector {
/**
* A private method that adds a name (String or byte array) to the
* issuerNames criterion. The issuer distinguished
- * name in the X509CRL 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 @@ public class X509CRLSelector implements CRLSelector {
* Clone and check an argument of the form passed to
* setIssuerNames. Throw an IOException if the argument is malformed.
*
- * @param names a Collection 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). null is
+ * DER encoded form, respectively). {@code null} is
* not an acceptable value.
- * @return a deep copy of the specified Collection
+ * @return a deep copy of the specified {@code Collection}
* @throws IOException if a parsing error occurs
*/
private static HashSet
*
* @since 1.3
diff --git a/src/share/classes/java/sql/SQLXML.java b/src/share/classes/java/sql/SQLXML.java
index 88e3baada72ed3b3fa237a59dca02255e05b51b9..2acc5d1d350a1514a4a700a34c1929a6b9ad6ae7 100644
--- a/src/share/classes/java/sql/SQLXML.java
+++ b/src/share/classes/java/sql/SQLXML.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2006, 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
@@ -360,6 +360,7 @@ public interface SQLXML
* xmlReader.parse(saxSource.getInputSource());
*
*
+ * @param the type of the class modeled by this Class object
* @param sourceClass The class of the source, or null.
* If the class is null, a vendor specifc Source implementation will be returned.
* The following classes are supported at a minimum:
@@ -401,6 +402,7 @@ public interface SQLXML
* contentHandler.endDocument();
*
*
+ * @param the type of the class modeled by this Class object
* @param resultClass The class of the result, or null.
* If resultClass is null, a vendor specific Result implementation will be returned.
* The following classes are supported at a minimum:
diff --git a/src/share/classes/java/sql/Wrapper.java b/src/share/classes/java/sql/Wrapper.java
index 2eaa003f2404a14704f0f7d032d76701a440f5f0..ee77431c0cdfe1d0e6e0fbd77628456b2a93d161 100644
--- a/src/share/classes/java/sql/Wrapper.java
+++ b/src/share/classes/java/sql/Wrapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2006, 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
@@ -53,6 +53,7 @@ public interface Wrapper {
* or a proxy for that result. If the receiver is not a
* wrapper and does not implement the interface, then an SQLException is thrown.
*
+ * @param the type of the class modeled by this Class object
* @param iface A Class defining an interface that the result must implement.
* @return an object that implements the interface. May be a proxy for the actual implementing object.
* @throws java.sql.SQLException If no object found that implements the interface
diff --git a/src/share/classes/java/time/format/DateTimeFormatter.java b/src/share/classes/java/time/format/DateTimeFormatter.java
index 158c741dff4e1e73866aedadbd43575a1b7f2160..2552f96e5ad36f3e5abdb8343eaff2bcaa418e82 100644
--- a/src/share/classes/java/time/format/DateTimeFormatter.java
+++ b/src/share/classes/java/time/format/DateTimeFormatter.java
@@ -1304,6 +1304,7 @@ public final class DateTimeFormatter {
* LocalTime time = parsed.query(LocalTime::from);
* Period extraDays = parsed.query(DateTimeFormatter.parsedExcessDays());
*
+ * @return a query that provides access to the excess days that were parsed
*/
public static final TemporalQuery parsedExcessDays() {
return PARSED_EXCESS_DAYS;
@@ -1344,6 +1345,7 @@ public final class DateTimeFormatter {
* // validate leap-second is correct and apply correct smoothing
* }
*
+ * @return a query that provides access to whether a leap-second was parsed
*/
public static final TemporalQuery parsedLeapSecond() {
return PARSED_LEAP_SECOND;
diff --git a/src/share/classes/java/util/ArrayPrefixHelpers.java b/src/share/classes/java/util/ArrayPrefixHelpers.java
new file mode 100644
index 0000000000000000000000000000000000000000..ef59ec7d47897ab3cfe181974dd9bbf07919322c
--- /dev/null
+++ b/src/share/classes/java/util/ArrayPrefixHelpers.java
@@ -0,0 +1,697 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. 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.util;
+
+/*
+ * Written by Doug Lea with assistance from members of JCP JSR-166
+ * Expert Group and released to the public domain, as explained at
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+import java.util.concurrent.ForkJoinPool;
+import java.util.concurrent.CountedCompleter;
+import java.util.function.BinaryOperator;
+import java.util.function.IntBinaryOperator;
+import java.util.function.LongBinaryOperator;
+import java.util.function.DoubleBinaryOperator;
+
+/**
+ * ForkJoin tasks to perform Arrays.parallelPrefix operations.
+ *
+ * @author Doug Lea
+ * @since 1.8
+ */
+class ArrayPrefixHelpers {
+ private ArrayPrefixHelpers() {}; // non-instantiable
+
+ /*
+ * Parallel prefix (aka cumulate, scan) task classes
+ * are based loosely on Guy Blelloch's original
+ * algorithm (http://www.cs.cmu.edu/~scandal/alg/scan.html):
+ * Keep dividing by two to threshold segment size, and then:
+ * Pass 1: Create tree of partial sums for each segment
+ * Pass 2: For each segment, cumulate with offset of left sibling
+ *
+ * This version improves performance within FJ framework mainly by
+ * allowing the second pass of ready left-hand sides to proceed
+ * even if some right-hand side first passes are still executing.
+ * It also combines first and second pass for leftmost segment,
+ * and skips the first pass for rightmost segment (whose result is
+ * not needed for second pass). It similarly manages to avoid
+ * requiring that users supply an identity basis for accumulations
+ * by tracking those segments/subtasks for which the first
+ * existing element is used as base.
+ *
+ * Managing this relies on ORing some bits in the pendingCount for
+ * phases/states: CUMULATE, SUMMED, and FINISHED. CUMULATE is the
+ * main phase bit. When false, segments compute only their sum.
+ * When true, they cumulate array elements. CUMULATE is set at
+ * root at beginning of second pass and then propagated down. But
+ * it may also be set earlier for subtrees with lo==0 (the left
+ * spine of tree). SUMMED is a one bit join count. For leafs, it
+ * is set when summed. For internal nodes, it becomes true when
+ * one child is summed. When the second child finishes summing,
+ * we then moves up tree to trigger the cumulate phase. FINISHED
+ * is also a one bit join count. For leafs, it is set when
+ * cumulated. For internal nodes, it becomes true when one child
+ * is cumulated. When the second child finishes cumulating, it
+ * then moves up tree, completing at the root.
+ *
+ * To better exploit locality and reduce overhead, the compute
+ * method loops starting with the current task, moving if possible
+ * to one of its subtasks rather than forking.
+ *
+ * As usual for this sort of utility, there are 4 versions, that
+ * are simple copy/paste/adapt variants of each other. (The
+ * double and int versions differ from long version soley by
+ * replacing "long" (with case-matching)).
+ */
+
+ // see above
+ static final int CUMULATE = 1;
+ static final int SUMMED = 2;
+ static final int FINISHED = 4;
+
+ /** The smallest subtask array partition size to use as threshold */
+ static final int MIN_PARTITION = 16;
+
+ static final class CumulateTask extends CountedCompleter {
+ final T[] array;
+ final BinaryOperator function;
+ CumulateTask left, right;
+ T in, out;
+ final int lo, hi, origin, fence, threshold;
+
+ /** Root task constructor */
+ public CumulateTask(CumulateTask parent,
+ BinaryOperator function,
+ T[] array, int lo, int hi) {
+ super(parent);
+ this.function = function; this.array = array;
+ this.lo = this.origin = lo; this.hi = this.fence = hi;
+ int p;
+ this.threshold =
+ (p = (hi - lo) / (ForkJoinPool.getCommonPoolParallelism() << 3))
+ <= MIN_PARTITION ? MIN_PARTITION : p;
+ }
+
+ /** Subtask constructor */
+ CumulateTask(CumulateTask parent, BinaryOperator function,
+ T[] array, int origin, int fence, int threshold,
+ int lo, int hi) {
+ super(parent);
+ this.function = function; this.array = array;
+ this.origin = origin; this.fence = fence;
+ this.threshold = threshold;
+ this.lo = lo; this.hi = hi;
+ }
+
+ public final void compute() {
+ final BinaryOperator fn;
+ final T[] a;
+ if ((fn = this.function) == null || (a = this.array) == null)
+ throw new NullPointerException(); // hoist checks
+ int th = threshold, org = origin, fnc = fence, l, h;
+ CumulateTask t = this;
+ outer: while ((l = t.lo) >= 0 && (h = t.hi) <= a.length) {
+ if (h - l > th) {
+ CumulateTask lt = t.left, rt = t.right, f;
+ if (lt == null) { // first pass
+ int mid = (l + h) >>> 1;
+ f = rt = t.right =
+ new CumulateTask(t, fn, a, org, fnc, th, mid, h);
+ t = lt = t.left =
+ new CumulateTask(t, fn, a, org, fnc, th, l, mid);
+ }
+ else { // possibly refork
+ T pin = t.in;
+ lt.in = pin;
+ f = t = null;
+ if (rt != null) {
+ T lout = lt.out;
+ rt.in = (l == org ? lout :
+ fn.apply(pin, lout));
+ for (int c;;) {
+ if (((c = rt.getPendingCount()) & CUMULATE) != 0)
+ break;
+ if (rt.compareAndSetPendingCount(c, c|CUMULATE)){
+ t = rt;
+ break;
+ }
+ }
+ }
+ for (int c;;) {
+ if (((c = lt.getPendingCount()) & CUMULATE) != 0)
+ break;
+ if (lt.compareAndSetPendingCount(c, c|CUMULATE)) {
+ if (t != null)
+ f = t;
+ t = lt;
+ break;
+ }
+ }
+ if (t == null)
+ break;
+ }
+ if (f != null)
+ f.fork();
+ }
+ else {
+ int state; // Transition to sum, cumulate, or both
+ for (int b;;) {
+ if (((b = t.getPendingCount()) & FINISHED) != 0)
+ break outer; // already done
+ state = ((b & CUMULATE) != 0? FINISHED :
+ (l > org) ? SUMMED : (SUMMED|FINISHED));
+ if (t.compareAndSetPendingCount(b, b|state))
+ break;
+ }
+
+ T sum;
+ if (state != SUMMED) {
+ int first;
+ if (l == org) { // leftmost; no in
+ sum = a[org];
+ first = org + 1;
+ }
+ else {
+ sum = t.in;
+ first = l;
+ }
+ for (int i = first; i < h; ++i) // cumulate
+ a[i] = sum = fn.apply(sum, a[i]);
+ }
+ else if (h < fnc) { // skip rightmost
+ sum = a[l];
+ for (int i = l + 1; i < h; ++i) // sum only
+ sum = fn.apply(sum, a[i]);
+ }
+ else
+ sum = t.in;
+ t.out = sum;
+ for (CumulateTask par;;) { // propagate
+ if ((par = (CumulateTask)t.getCompleter()) == null) {
+ if ((state & FINISHED) != 0) // enable join
+ t.quietlyComplete();
+ break outer;
+ }
+ int b = par.getPendingCount();
+ if ((b & state & FINISHED) != 0)
+ t = par; // both done
+ else if ((b & state & SUMMED) != 0) { // both summed
+ int nextState; CumulateTask lt, rt;
+ if ((lt = par.left) != null &&
+ (rt = par.right) != null) {
+ T lout = lt.out;
+ par.out = (rt.hi == fnc ? lout :
+ fn.apply(lout, rt.out));
+ }
+ int refork = (((b & CUMULATE) == 0 &&
+ par.lo == org) ? CUMULATE : 0);
+ if ((nextState = b|state|refork) == b ||
+ par.compareAndSetPendingCount(b, nextState)) {
+ state = SUMMED; // drop finished
+ t = par;
+ if (refork != 0)
+ par.fork();
+ }
+ }
+ else if (par.compareAndSetPendingCount(b, b|state))
+ break outer; // sib not ready
+ }
+ }
+ }
+ }
+ }
+
+ static final class LongCumulateTask extends CountedCompleter {
+ final long[] array;
+ final LongBinaryOperator function;
+ LongCumulateTask left, right;
+ long in, out;
+ final int lo, hi, origin, fence, threshold;
+
+ /** Root task constructor */
+ public LongCumulateTask(LongCumulateTask parent,
+ LongBinaryOperator function,
+ long[] array, int lo, int hi) {
+ super(parent);
+ this.function = function; this.array = array;
+ this.lo = this.origin = lo; this.hi = this.fence = hi;
+ int p;
+ this.threshold =
+ (p = (hi - lo) / (ForkJoinPool.getCommonPoolParallelism() << 3))
+ <= MIN_PARTITION ? MIN_PARTITION : p;
+ }
+
+ /** Subtask constructor */
+ LongCumulateTask(LongCumulateTask parent, LongBinaryOperator function,
+ long[] array, int origin, int fence, int threshold,
+ int lo, int hi) {
+ super(parent);
+ this.function = function; this.array = array;
+ this.origin = origin; this.fence = fence;
+ this.threshold = threshold;
+ this.lo = lo; this.hi = hi;
+ }
+
+ public final void compute() {
+ final LongBinaryOperator fn;
+ final long[] a;
+ if ((fn = this.function) == null || (a = this.array) == null)
+ throw new NullPointerException(); // hoist checks
+ int th = threshold, org = origin, fnc = fence, l, h;
+ LongCumulateTask t = this;
+ outer: while ((l = t.lo) >= 0 && (h = t.hi) <= a.length) {
+ if (h - l > th) {
+ LongCumulateTask lt = t.left, rt = t.right, f;
+ if (lt == null) { // first pass
+ int mid = (l + h) >>> 1;
+ f = rt = t.right =
+ new LongCumulateTask(t, fn, a, org, fnc, th, mid, h);
+ t = lt = t.left =
+ new LongCumulateTask(t, fn, a, org, fnc, th, l, mid);
+ }
+ else { // possibly refork
+ long pin = t.in;
+ lt.in = pin;
+ f = t = null;
+ if (rt != null) {
+ long lout = lt.out;
+ rt.in = (l == org ? lout :
+ fn.applyAsLong(pin, lout));
+ for (int c;;) {
+ if (((c = rt.getPendingCount()) & CUMULATE) != 0)
+ break;
+ if (rt.compareAndSetPendingCount(c, c|CUMULATE)){
+ t = rt;
+ break;
+ }
+ }
+ }
+ for (int c;;) {
+ if (((c = lt.getPendingCount()) & CUMULATE) != 0)
+ break;
+ if (lt.compareAndSetPendingCount(c, c|CUMULATE)) {
+ if (t != null)
+ f = t;
+ t = lt;
+ break;
+ }
+ }
+ if (t == null)
+ break;
+ }
+ if (f != null)
+ f.fork();
+ }
+ else {
+ int state; // Transition to sum, cumulate, or both
+ for (int b;;) {
+ if (((b = t.getPendingCount()) & FINISHED) != 0)
+ break outer; // already done
+ state = ((b & CUMULATE) != 0? FINISHED :
+ (l > org) ? SUMMED : (SUMMED|FINISHED));
+ if (t.compareAndSetPendingCount(b, b|state))
+ break;
+ }
+
+ long sum;
+ if (state != SUMMED) {
+ int first;
+ if (l == org) { // leftmost; no in
+ sum = a[org];
+ first = org + 1;
+ }
+ else {
+ sum = t.in;
+ first = l;
+ }
+ for (int i = first; i < h; ++i) // cumulate
+ a[i] = sum = fn.applyAsLong(sum, a[i]);
+ }
+ else if (h < fnc) { // skip rightmost
+ sum = a[l];
+ for (int i = l + 1; i < h; ++i) // sum only
+ sum = fn.applyAsLong(sum, a[i]);
+ }
+ else
+ sum = t.in;
+ t.out = sum;
+ for (LongCumulateTask par;;) { // propagate
+ if ((par = (LongCumulateTask)t.getCompleter()) == null) {
+ if ((state & FINISHED) != 0) // enable join
+ t.quietlyComplete();
+ break outer;
+ }
+ int b = par.getPendingCount();
+ if ((b & state & FINISHED) != 0)
+ t = par; // both done
+ else if ((b & state & SUMMED) != 0) { // both summed
+ int nextState; LongCumulateTask lt, rt;
+ if ((lt = par.left) != null &&
+ (rt = par.right) != null) {
+ long lout = lt.out;
+ par.out = (rt.hi == fnc ? lout :
+ fn.applyAsLong(lout, rt.out));
+ }
+ int refork = (((b & CUMULATE) == 0 &&
+ par.lo == org) ? CUMULATE : 0);
+ if ((nextState = b|state|refork) == b ||
+ par.compareAndSetPendingCount(b, nextState)) {
+ state = SUMMED; // drop finished
+ t = par;
+ if (refork != 0)
+ par.fork();
+ }
+ }
+ else if (par.compareAndSetPendingCount(b, b|state))
+ break outer; // sib not ready
+ }
+ }
+ }
+ }
+ }
+
+ static final class DoubleCumulateTask extends CountedCompleter {
+ final double[] array;
+ final DoubleBinaryOperator function;
+ DoubleCumulateTask left, right;
+ double in, out;
+ final int lo, hi, origin, fence, threshold;
+
+ /** Root task constructor */
+ public DoubleCumulateTask(DoubleCumulateTask parent,
+ DoubleBinaryOperator function,
+ double[] array, int lo, int hi) {
+ super(parent);
+ this.function = function; this.array = array;
+ this.lo = this.origin = lo; this.hi = this.fence = hi;
+ int p;
+ this.threshold =
+ (p = (hi - lo) / (ForkJoinPool.getCommonPoolParallelism() << 3))
+ <= MIN_PARTITION ? MIN_PARTITION : p;
+ }
+
+ /** Subtask constructor */
+ DoubleCumulateTask(DoubleCumulateTask parent, DoubleBinaryOperator function,
+ double[] array, int origin, int fence, int threshold,
+ int lo, int hi) {
+ super(parent);
+ this.function = function; this.array = array;
+ this.origin = origin; this.fence = fence;
+ this.threshold = threshold;
+ this.lo = lo; this.hi = hi;
+ }
+
+ public final void compute() {
+ final DoubleBinaryOperator fn;
+ final double[] a;
+ if ((fn = this.function) == null || (a = this.array) == null)
+ throw new NullPointerException(); // hoist checks
+ int th = threshold, org = origin, fnc = fence, l, h;
+ DoubleCumulateTask t = this;
+ outer: while ((l = t.lo) >= 0 && (h = t.hi) <= a.length) {
+ if (h - l > th) {
+ DoubleCumulateTask lt = t.left, rt = t.right, f;
+ if (lt == null) { // first pass
+ int mid = (l + h) >>> 1;
+ f = rt = t.right =
+ new DoubleCumulateTask(t, fn, a, org, fnc, th, mid, h);
+ t = lt = t.left =
+ new DoubleCumulateTask(t, fn, a, org, fnc, th, l, mid);
+ }
+ else { // possibly refork
+ double pin = t.in;
+ lt.in = pin;
+ f = t = null;
+ if (rt != null) {
+ double lout = lt.out;
+ rt.in = (l == org ? lout :
+ fn.applyAsDouble(pin, lout));
+ for (int c;;) {
+ if (((c = rt.getPendingCount()) & CUMULATE) != 0)
+ break;
+ if (rt.compareAndSetPendingCount(c, c|CUMULATE)){
+ t = rt;
+ break;
+ }
+ }
+ }
+ for (int c;;) {
+ if (((c = lt.getPendingCount()) & CUMULATE) != 0)
+ break;
+ if (lt.compareAndSetPendingCount(c, c|CUMULATE)) {
+ if (t != null)
+ f = t;
+ t = lt;
+ break;
+ }
+ }
+ if (t == null)
+ break;
+ }
+ if (f != null)
+ f.fork();
+ }
+ else {
+ int state; // Transition to sum, cumulate, or both
+ for (int b;;) {
+ if (((b = t.getPendingCount()) & FINISHED) != 0)
+ break outer; // already done
+ state = ((b & CUMULATE) != 0? FINISHED :
+ (l > org) ? SUMMED : (SUMMED|FINISHED));
+ if (t.compareAndSetPendingCount(b, b|state))
+ break;
+ }
+
+ double sum;
+ if (state != SUMMED) {
+ int first;
+ if (l == org) { // leftmost; no in
+ sum = a[org];
+ first = org + 1;
+ }
+ else {
+ sum = t.in;
+ first = l;
+ }
+ for (int i = first; i < h; ++i) // cumulate
+ a[i] = sum = fn.applyAsDouble(sum, a[i]);
+ }
+ else if (h < fnc) { // skip rightmost
+ sum = a[l];
+ for (int i = l + 1; i < h; ++i) // sum only
+ sum = fn.applyAsDouble(sum, a[i]);
+ }
+ else
+ sum = t.in;
+ t.out = sum;
+ for (DoubleCumulateTask par;;) { // propagate
+ if ((par = (DoubleCumulateTask)t.getCompleter()) == null) {
+ if ((state & FINISHED) != 0) // enable join
+ t.quietlyComplete();
+ break outer;
+ }
+ int b = par.getPendingCount();
+ if ((b & state & FINISHED) != 0)
+ t = par; // both done
+ else if ((b & state & SUMMED) != 0) { // both summed
+ int nextState; DoubleCumulateTask lt, rt;
+ if ((lt = par.left) != null &&
+ (rt = par.right) != null) {
+ double lout = lt.out;
+ par.out = (rt.hi == fnc ? lout :
+ fn.applyAsDouble(lout, rt.out));
+ }
+ int refork = (((b & CUMULATE) == 0 &&
+ par.lo == org) ? CUMULATE : 0);
+ if ((nextState = b|state|refork) == b ||
+ par.compareAndSetPendingCount(b, nextState)) {
+ state = SUMMED; // drop finished
+ t = par;
+ if (refork != 0)
+ par.fork();
+ }
+ }
+ else if (par.compareAndSetPendingCount(b, b|state))
+ break outer; // sib not ready
+ }
+ }
+ }
+ }
+ }
+
+ static final class IntCumulateTask extends CountedCompleter {
+ final int[] array;
+ final IntBinaryOperator function;
+ IntCumulateTask left, right;
+ int in, out;
+ final int lo, hi, origin, fence, threshold;
+
+ /** Root task constructor */
+ public IntCumulateTask(IntCumulateTask parent,
+ IntBinaryOperator function,
+ int[] array, int lo, int hi) {
+ super(parent);
+ this.function = function; this.array = array;
+ this.lo = this.origin = lo; this.hi = this.fence = hi;
+ int p;
+ this.threshold =
+ (p = (hi - lo) / (ForkJoinPool.getCommonPoolParallelism() << 3))
+ <= MIN_PARTITION ? MIN_PARTITION : p;
+ }
+
+ /** Subtask constructor */
+ IntCumulateTask(IntCumulateTask parent, IntBinaryOperator function,
+ int[] array, int origin, int fence, int threshold,
+ int lo, int hi) {
+ super(parent);
+ this.function = function; this.array = array;
+ this.origin = origin; this.fence = fence;
+ this.threshold = threshold;
+ this.lo = lo; this.hi = hi;
+ }
+
+ public final void compute() {
+ final IntBinaryOperator fn;
+ final int[] a;
+ if ((fn = this.function) == null || (a = this.array) == null)
+ throw new NullPointerException(); // hoist checks
+ int th = threshold, org = origin, fnc = fence, l, h;
+ IntCumulateTask t = this;
+ outer: while ((l = t.lo) >= 0 && (h = t.hi) <= a.length) {
+ if (h - l > th) {
+ IntCumulateTask lt = t.left, rt = t.right, f;
+ if (lt == null) { // first pass
+ int mid = (l + h) >>> 1;
+ f = rt = t.right =
+ new IntCumulateTask(t, fn, a, org, fnc, th, mid, h);
+ t = lt = t.left =
+ new IntCumulateTask(t, fn, a, org, fnc, th, l, mid);
+ }
+ else { // possibly refork
+ int pin = t.in;
+ lt.in = pin;
+ f = t = null;
+ if (rt != null) {
+ int lout = lt.out;
+ rt.in = (l == org ? lout :
+ fn.applyAsInt(pin, lout));
+ for (int c;;) {
+ if (((c = rt.getPendingCount()) & CUMULATE) != 0)
+ break;
+ if (rt.compareAndSetPendingCount(c, c|CUMULATE)){
+ t = rt;
+ break;
+ }
+ }
+ }
+ for (int c;;) {
+ if (((c = lt.getPendingCount()) & CUMULATE) != 0)
+ break;
+ if (lt.compareAndSetPendingCount(c, c|CUMULATE)) {
+ if (t != null)
+ f = t;
+ t = lt;
+ break;
+ }
+ }
+ if (t == null)
+ break;
+ }
+ if (f != null)
+ f.fork();
+ }
+ else {
+ int state; // Transition to sum, cumulate, or both
+ for (int b;;) {
+ if (((b = t.getPendingCount()) & FINISHED) != 0)
+ break outer; // already done
+ state = ((b & CUMULATE) != 0? FINISHED :
+ (l > org) ? SUMMED : (SUMMED|FINISHED));
+ if (t.compareAndSetPendingCount(b, b|state))
+ break;
+ }
+
+ int sum;
+ if (state != SUMMED) {
+ int first;
+ if (l == org) { // leftmost; no in
+ sum = a[org];
+ first = org + 1;
+ }
+ else {
+ sum = t.in;
+ first = l;
+ }
+ for (int i = first; i < h; ++i) // cumulate
+ a[i] = sum = fn.applyAsInt(sum, a[i]);
+ }
+ else if (h < fnc) { // skip rightmost
+ sum = a[l];
+ for (int i = l + 1; i < h; ++i) // sum only
+ sum = fn.applyAsInt(sum, a[i]);
+ }
+ else
+ sum = t.in;
+ t.out = sum;
+ for (IntCumulateTask par;;) { // propagate
+ if ((par = (IntCumulateTask)t.getCompleter()) == null) {
+ if ((state & FINISHED) != 0) // enable join
+ t.quietlyComplete();
+ break outer;
+ }
+ int b = par.getPendingCount();
+ if ((b & state & FINISHED) != 0)
+ t = par; // both done
+ else if ((b & state & SUMMED) != 0) { // both summed
+ int nextState; IntCumulateTask lt, rt;
+ if ((lt = par.left) != null &&
+ (rt = par.right) != null) {
+ int lout = lt.out;
+ par.out = (rt.hi == fnc ? lout :
+ fn.applyAsInt(lout, rt.out));
+ }
+ int refork = (((b & CUMULATE) == 0 &&
+ par.lo == org) ? CUMULATE : 0);
+ if ((nextState = b|state|refork) == b ||
+ par.compareAndSetPendingCount(b, nextState)) {
+ state = SUMMED; // drop finished
+ t = par;
+ if (refork != 0)
+ par.fork();
+ }
+ }
+ else if (par.compareAndSetPendingCount(b, b|state))
+ break outer; // sib not ready
+ }
+ }
+ }
+ }
+ }
+
+
+}
\ No newline at end of file
diff --git a/src/share/classes/java/util/Arrays.java b/src/share/classes/java/util/Arrays.java
index 4035666d2ab7130153b6e069ae15fd0be0c56f84..196a31e5767e9f92e43eefb077765218e2accb05 100644
--- a/src/share/classes/java/util/Arrays.java
+++ b/src/share/classes/java/util/Arrays.java
@@ -1559,6 +1559,183 @@ public class Arrays {
}
}
+ // Parallel prefix
+
+ /**
+ * Cumulates, in parallel, each element of the given array in place,
+ * using the supplied function. For example if the array initially
+ * holds {@code [2, 1, 0, 3]} and the operation performs addition,
+ * then upon return the array holds {@code [2, 3, 3, 6]}.
+ * Parallel prefix computation is usually more efficient than
+ * sequential loops for large arrays.
+ *
+ * @param array the array, which is modified in-place by this method
+ * @param op a side-effect-free, associative function to perform the
+ * cumulation
+ * @throws NullPointerException if the specified array or function is null
+ * @since 1.8
+ */
+ public static void parallelPrefix(T[] array, BinaryOperator op) {
+ if (array.length > 0)
+ new ArrayPrefixHelpers.CumulateTask<>
+ (null, op, array, 0, array.length).invoke();
+ }
+
+ /**
+ * Performs {@link #parallelPrefix(Object[], BinaryOperator)}
+ * for the given subrange of the array.
+ *
+ * @param array the array
+ * @param fromIndex the index of the first element, inclusive
+ * @param toIndex the index of the last element, exclusive
+ * @param op a side-effect-free, associative function to perform the
+ * cumulation
+ * @throws IllegalArgumentException if {@code fromIndex > toIndex}
+ * @throws ArrayIndexOutOfBoundsException
+ * if {@code fromIndex < 0} or {@code toIndex > array.length}
+ * @throws NullPointerException if the specified array or function is null
+ * @since 1.8
+ */
+ public static void parallelPrefix(T[] array, int fromIndex,
+ int toIndex, BinaryOperator op) {
+ rangeCheck(array.length, fromIndex, toIndex);
+ if (fromIndex < toIndex)
+ new ArrayPrefixHelpers.CumulateTask<>
+ (null, op, array, fromIndex, toIndex).invoke();
+ }
+
+ /**
+ * Cumulates, in parallel, each element of the given array in place,
+ * using the supplied function. For example if the array initially
+ * holds {@code [2, 1, 0, 3]} and the operation performs addition,
+ * then upon return the array holds {@code [2, 3, 3, 6]}.
+ * Parallel prefix computation is usually more efficient than
+ * sequential loops for large arrays.
+ *
+ * @param array the array, which is modified in-place by this method
+ * @param op a side-effect-free, associative function to perform the
+ * cumulation
+ * @throws NullPointerException if the specified array or function is null
+ * @since 1.8
+ */
+ public static void parallelPrefix(long[] array, LongBinaryOperator op) {
+ if (array.length > 0)
+ new ArrayPrefixHelpers.LongCumulateTask
+ (null, op, array, 0, array.length).invoke();
+ }
+
+ /**
+ * Performs {@link #parallelPrefix(long[], LongBinaryOperator)}
+ * for the given subrange of the array.
+ *
+ * @param array the array
+ * @param fromIndex the index of the first element, inclusive
+ * @param toIndex the index of the last element, exclusive
+ * @param op a side-effect-free, associative function to perform the
+ * cumulation
+ * @throws IllegalArgumentException if {@code fromIndex > toIndex}
+ * @throws ArrayIndexOutOfBoundsException
+ * if {@code fromIndex < 0} or {@code toIndex > array.length}
+ * @throws NullPointerException if the specified array or function is null
+ * @since 1.8
+ */
+ public static void parallelPrefix(long[] array, int fromIndex,
+ int toIndex, LongBinaryOperator op) {
+ rangeCheck(array.length, fromIndex, toIndex);
+ if (fromIndex < toIndex)
+ new ArrayPrefixHelpers.LongCumulateTask
+ (null, op, array, fromIndex, toIndex).invoke();
+ }
+
+ /**
+ * Cumulates, in parallel, each element of the given array in place,
+ * using the supplied function. For example if the array initially
+ * holds {@code [2.0, 1.0, 0.0, 3.0]} and the operation performs addition,
+ * then upon return the array holds {@code [2.0, 3.0, 3.0, 6.0]}.
+ * Parallel prefix computation is usually more efficient than
+ * sequential loops for large arrays.
+ *
+ *
Because floating-point operations may not be strictly associative,
+ * the returned result may not be identical to the value that would be
+ * obtained if the operation was performed sequentially.
+ *
+ * @param array the array, which is modified in-place by this method
+ * @param op a side-effect-free function to perform the cumulation
+ * @throws NullPointerException if the specified array or function is null
+ * @since 1.8
+ */
+ public static void parallelPrefix(double[] array, DoubleBinaryOperator op) {
+ if (array.length > 0)
+ new ArrayPrefixHelpers.DoubleCumulateTask
+ (null, op, array, 0, array.length).invoke();
+ }
+
+ /**
+ * Performs {@link #parallelPrefix(double[], DoubleBinaryOperator)}
+ * for the given subrange of the array.
+ *
+ * @param array the array
+ * @param fromIndex the index of the first element, inclusive
+ * @param toIndex the index of the last element, exclusive
+ * @param op a side-effect-free, associative function to perform the
+ * cumulation
+ * @throws IllegalArgumentException if {@code fromIndex > toIndex}
+ * @throws ArrayIndexOutOfBoundsException
+ * if {@code fromIndex < 0} or {@code toIndex > array.length}
+ * @throws NullPointerException if the specified array or function is null
+ * @since 1.8
+ */
+ public static void parallelPrefix(double[] array, int fromIndex,
+ int toIndex, DoubleBinaryOperator op) {
+ rangeCheck(array.length, fromIndex, toIndex);
+ if (fromIndex < toIndex)
+ new ArrayPrefixHelpers.DoubleCumulateTask
+ (null, op, array, fromIndex, toIndex).invoke();
+ }
+
+ /**
+ * Cumulates, in parallel, each element of the given array in place,
+ * using the supplied function. For example if the array initially
+ * holds {@code [2, 1, 0, 3]} and the operation performs addition,
+ * then upon return the array holds {@code [2, 3, 3, 6]}.
+ * Parallel prefix computation is usually more efficient than
+ * sequential loops for large arrays.
+ *
+ * @param array the array, which is modified in-place by this method
+ * @param op a side-effect-free, associative function to perform the
+ * cumulation
+ * @throws NullPointerException if the specified array or function is null
+ * @since 1.8
+ */
+ public static void parallelPrefix(int[] array, IntBinaryOperator op) {
+ if (array.length > 0)
+ new ArrayPrefixHelpers.IntCumulateTask
+ (null, op, array, 0, array.length).invoke();
+ }
+
+ /**
+ * Performs {@link #parallelPrefix(int[], IntBinaryOperator)}
+ * for the given subrange of the array.
+ *
+ * @param array the array
+ * @param fromIndex the index of the first element, inclusive
+ * @param toIndex the index of the last element, exclusive
+ * @param op a side-effect-free, associative function to perform the
+ * cumulation
+ * @throws IllegalArgumentException if {@code fromIndex > toIndex}
+ * @throws ArrayIndexOutOfBoundsException
+ * if {@code fromIndex < 0} or {@code toIndex > array.length}
+ * @throws NullPointerException if the specified array or function is null
+ * @since 1.8
+ */
+ public static void parallelPrefix(int[] array, int fromIndex,
+ int toIndex, IntBinaryOperator op) {
+ rangeCheck(array.length, fromIndex, toIndex);
+ if (fromIndex < toIndex)
+ new ArrayPrefixHelpers.IntCumulateTask
+ (null, op, array, fromIndex, toIndex).invoke();
+ }
+
// Searching
/**
diff --git a/src/share/classes/java/util/Collections.java b/src/share/classes/java/util/Collections.java
index da258793ba635548c50177780efae634990f9cd5..ad4540db14a710e9ae2ccba635f67534b4dc2f3d 100644
--- a/src/share/classes/java/util/Collections.java
+++ b/src/share/classes/java/util/Collections.java
@@ -4304,6 +4304,11 @@ public class Collections {
}
private Object readResolve() { return Collections.reverseOrder(); }
+
+ @Override
+ public Comparator> reversed() {
+ return Comparator.naturalOrder();
+ }
}
/**
@@ -4367,6 +4372,11 @@ public class Collections {
public int hashCode() {
return cmp.hashCode() ^ Integer.MIN_VALUE;
}
+
+ @Override
+ public Comparator reversed() {
+ return cmp;
+ }
}
/**
diff --git a/src/share/classes/java/util/Comparator.java b/src/share/classes/java/util/Comparator.java
index 017c2e78e2ced52e4167a4328711c49264ebe0d7..cd65ca4ea06e05e5314cd68f9ce2f2a9ae1d4f7e 100644
--- a/src/share/classes/java/util/Comparator.java
+++ b/src/share/classes/java/util/Comparator.java
@@ -25,10 +25,12 @@
package java.util;
+import java.io.Serializable;
import java.util.function.Function;
import java.util.function.ToIntFunction;
import java.util.function.ToLongFunction;
import java.util.function.ToDoubleFunction;
+import java.util.Comparators;
/**
* A comparison function, which imposes a total ordering on some
@@ -175,88 +177,357 @@ public interface Comparator {
* Returns a comparator that imposes the reverse ordering of this
* comparator.
*
- * @return A comparator that imposes the reverse ordering of this
+ * @return a comparator that imposes the reverse ordering of this
* comparator.
* @since 1.8
*/
- default Comparator reverseOrder() {
+ default Comparator reversed() {
return Collections.reverseOrder(this);
}
/**
- * Constructs a lexicographic order comparator with another comparator.
- * For example, a {@code Comparator byLastName} can be composed
- * with another {@code Comparator byFirstName}, then {@code
- * byLastName.thenComparing(byFirstName)} creates a {@code
- * Comparator} which sorts by last name, and for equal last names
- * sorts by first name.
- *
- * @param other the other comparator used when equals on this.
+ * Returns a lexicographic-order comparator with another comparator.
+ * If this {@code Comparator} considers two elements equal, i.e.
+ * {@code compare(a, b) == 0}, {@code other} is used to determine the order.
+ *
+ *
The returned comparator is serializable if the specified comparator
+ * is also serializable.
+ *
+ * @apiNote
+ * For example, to sort a collection of {@code String} based on the length
+ * and then case-insensitive natural ordering, the comparator can be
+ * composed using following code,
+ *
+ *
+ *
+ * @param other the other comparator to be used when this comparator
+ * compares two objects that are equal.
+ * @return a lexicographic-order comparator composed of this and then the
+ * other comparator
* @throws NullPointerException if the argument is null.
* @since 1.8
*/
default Comparator thenComparing(Comparator super T> other) {
- return Comparators.compose(this, other);
+ Objects.requireNonNull(other);
+ return (Comparator & Serializable) (c1, c2) -> {
+ int res = compare(c1, c2);
+ return (res != 0) ? res : other.compare(c1, c2);
+ };
}
/**
- * Constructs a lexicographic order comparator with a function that
- * extracts a {@code Comparable} key. This default implementation calls
- * {@code thenComparing(this, Comparators.comparing(keyExtractor))}.
+ * Returns a lexicographic-order comparator with a function that
+ * extracts a key to be compared with the given {@code Comparator}.
+ *
+ * @implSpec This default implementation behaves as if {@code
+ * thenComparing(comparing(keyExtractor, cmp))}.
*
- * @param the {@link Comparable} type for comparison
- * @param keyExtractor the function used to extract the {@link Comparable} sort key
+ * @param the type of the sort key
+ * @param keyExtractor the function used to extract the sort key
+ * @param keyComparator the {@code Comparator} used to compare the sort key
+ * @return a lexicographic-order comparator composed of this comparator
+ * and then comparing on the key extracted by the keyExtractor function
* @throws NullPointerException if the argument is null.
- * @see Comparators#comparing(Function)
+ * @see #comparing(Function, Comparator)
* @see #thenComparing(Comparator)
* @since 1.8
*/
- default > Comparator thenComparing(Function super T, ? extends U> keyExtractor) {
- return thenComparing(Comparators.comparing(keyExtractor));
+ default > Comparator thenComparing(
+ Function super T, ? extends U> keyExtractor,
+ Comparator super U> keyComparator)
+ {
+ return thenComparing(comparing(keyExtractor, keyComparator));
}
/**
- * Constructs a lexicographic order comparator with a function that
- * extracts a {@code int} value. This default implementation calls {@code
- * thenComparing(this, Comparators.comparing(keyExtractor))}.
+ * Returns a lexicographic-order comparator with a function that
+ * extracts a {@code Comparable} sort key.
+ *
+ * @implSpec This default implementation behaves as if {@code
+ * thenComparing(comparing(keyExtractor))}.
*
- * @param keyExtractor the function used to extract the integer value
+ * @param the type of the {@link Comparable} sort key
+ * @param keyExtractor the function used to extract the {@link
+ * Comparable} sort key
+ * @return a lexicographic-order comparator composed of this and then the
+ * {@link Comparable} sort key.
* @throws NullPointerException if the argument is null.
- * @see Comparators#comparing(ToIntFunction)
+ * @see #comparing(Function)
+ * @see #thenComparing(Comparator)
+ * @since 1.8
+ */
+ default > Comparator thenComparing(
+ Function super T, ? extends U> keyExtractor)
+ {
+ return thenComparing(comparing(keyExtractor));
+ }
+
+ /**
+ * Returns a lexicographic-order comparator with a function that
+ * extracts a {@code int} sort key.
+ *
+ * @implSpec This default implementation behaves as if {@code
+ * thenComparing(comparing(keyExtractor))}.
+ *
+ * @param keyExtractor the function used to extract the integer sort key
+ * @return a lexicographic-order comparator composed of this and then the
+ * {@code int} sort key
+ * @throws NullPointerException if the argument is null.
+ * @see #comparing(ToIntFunction)
* @see #thenComparing(Comparator)
* @since 1.8
*/
default Comparator thenComparing(ToIntFunction super T> keyExtractor) {
- return thenComparing(Comparators.comparing(keyExtractor));
+ return thenComparing(comparing(keyExtractor));
}
/**
- * Constructs a lexicographic order comparator with a function that
- * extracts a {@code long} value. This default implementation calls
- * {@code thenComparing(this, Comparators.comparing(keyExtractor))}.
+ * Returns a lexicographic-order comparator with a function that
+ * extracts a {@code long} sort key.
+ *
+ * @implSpec This default implementation behaves as if {@code
+ * thenComparing(comparing(keyExtractor))}.
*
- * @param keyExtractor the function used to extract the long value
+ * @param keyExtractor the function used to extract the long sort key
+ * @return a lexicographic-order comparator composed of this and then the
+ * {@code long} sort key
* @throws NullPointerException if the argument is null.
- * @see Comparators#comparing(ToLongFunction)
+ * @see #comparing(ToLongFunction)
* @see #thenComparing(Comparator)
* @since 1.8
*/
default Comparator thenComparing(ToLongFunction super T> keyExtractor) {
- return thenComparing(Comparators.comparing(keyExtractor));
+ return thenComparing(comparing(keyExtractor));
}
/**
- * Constructs a lexicographic order comparator with a function that
- * extracts a {@code double} value. This default implementation calls
- * {@code thenComparing(this, Comparators.comparing(keyExtractor))}.
+ * Returns a lexicographic-order comparator with a function that
+ * extracts a {@code double} sort key.
*
- * @param keyExtractor the function used to extract the double value
+ * @implSpec This default implementation behaves as if {@code
+ * thenComparing(comparing(keyExtractor))}.
+ *
+ * @param keyExtractor the function used to extract the double sort key
+ * @return a lexicographic-order comparator composed of this and then the
+ * {@code double} sort key
* @throws NullPointerException if the argument is null.
- * @see Comparators#comparing(ToDoubleFunction)
+ * @see #comparing(ToDoubleFunction)
* @see #thenComparing(Comparator)
* @since 1.8
*/
default Comparator thenComparing(ToDoubleFunction super T> keyExtractor) {
- return thenComparing(Comparators.comparing(keyExtractor));
+ return thenComparing(comparing(keyExtractor));
+ }
+
+ /**
+ * Returns a comparator that imposes the reverse of the natural
+ * ordering.
+ *
+ *
The returned comparator is serializable and throws {@link
+ * NullPointerException} when comparing {@code null}.
+ *
+ * @param the {@link Comparable} type of element to be compared
+ * @return a comparator that imposes the reverse of the natural
+ * ordering on {@code Comparable} objects.
+ * @see Comparable
+ * @since 1.8
+ */
+ public static > Comparator reverseOrder() {
+ return Collections.reverseOrder();
+ }
+
+ /**
+ * Returns a comparator that compares {@link Comparable} objects in natural
+ * order.
+ *
+ *
The returned comparator is serializable and throws {@link
+ * NullPointerException} when comparing {@code null}.
+ *
+ * @param the {@link Comparable} type of element to be compared
+ * @return a comparator that imposes the natural ordering on {@code
+ * Comparable} objects.
+ * @see Comparable
+ * @since 1.8
+ */
+ public static > Comparator naturalOrder() {
+ return (Comparator) Comparators.NaturalOrderComparator.INSTANCE;
+ }
+
+ /**
+ * Returns a null-friendly comparator that considers {@code null} to be
+ * less than non-null. When both are {@code null}, they are considered
+ * equal. If both are non-null, the specified {@code Comparator} is used
+ * to determine the order. If the specified comparator is {@code null},
+ * then the returned comparator considers all non-null values to be equal.
+ *
+ *
The returned comparator is serializable if the specified comparator
+ * is serializable.
+ *
+ * @param the type of the elements to be compared
+ * @param comparator a {@code Comparator} for comparing non-null values
+ * @return a comparator that considers {@code null} to be less than
+ * non-null, and compares non-null objects with the supplied
+ * {@code Comparator}.
+ * @since 1.8
+ */
+ public static Comparator nullsFirst(Comparator super T> comparator) {
+ return new Comparators.NullComparator(true, comparator);
+ }
+
+ /**
+ * Returns a null-friendly comparator that considers {@code null} to be
+ * greater than non-null. When both are {@code null}, they are considered
+ * equal. If both are non-null, the specified {@code Comparator} is used
+ * to determine the order. If the specified comparator is {@code null},
+ * then the returned comparator considers all non-null values to be equal.
+ *
+ *
The returned comparator is serializable if the specified comparator
+ * is serializable.
+ *
+ * @param the type of the elements to be compared
+ * @param comparator a {@code Comparator} for comparing non-null values
+ * @return a comparator that considers {@code null} to be greater than
+ * non-null, and compares non-null objects with the supplied
+ * {@code Comparator}.
+ * @since 1.8
+ */
+ public static Comparator nullsLast(Comparator super T> comparator) {
+ return new Comparators.NullComparator(false, comparator);
+ }
+
+ /**
+ * Accepts a function that extracts a sort key from a type {@code T}, and
+ * returns a {@code Comparator} that compares by that sort key using
+ * the specified {@link Comparator}.
+ *
+ *
The returned comparator is serializable if the specified function
+ * and comparator are both serializable.
+ *
+ * @apiNote
+ * For example, to obtain a {@code Comparator} that compares {@code
+ * Person} objects by their last name ignoring case differences,
+ *
+ *
+ *
+ * @param the type of element to be compared
+ * @param the type of the sort key
+ * @param keyExtractor the function used to extract the sort key
+ * @param keyComparator the {@code Comparator} used to compare the sort key
+ * @return a comparator that compares by an extracted key using the
+ * specified {@code Comparator}
+ * @throws NullPointerException if either argument is null
+ * @since 1.8
+ */
+ public static Comparator comparing(
+ Function super T, ? extends U> keyExtractor,
+ Comparator super U> keyComparator)
+ {
+ Objects.requireNonNull(keyExtractor);
+ Objects.requireNonNull(keyComparator);
+ return (Comparator & Serializable)
+ (c1, c2) -> keyComparator.compare(keyExtractor.apply(c1),
+ keyExtractor.apply(c2));
+ }
+
+ /**
+ * Accepts a function that extracts a {@link java.lang.Comparable
+ * Comparable} sort key from a type {@code T}, and returns a {@code
+ * Comparator} that compares by that sort key.
+ *
+ *
The returned comparator is serializable if the specified function
+ * is also serializable.
+ *
+ * @apiNote
+ * For example, to obtain a {@code Comparator} that compares {@code
+ * Person} objects by their last name,
+ *
+ *
+ *
+ * @param the type of element to be compared
+ * @param the type of the {@code Comparable} sort key
+ * @param keyExtractor the function used to extract the {@link
+ * Comparable} sort key
+ * @return a comparator that compares by an extracted key
+ * @throws NullPointerException if the argument is null
+ * @since 1.8
+ */
+ public static > Comparator comparing(
+ Function super T, ? extends U> keyExtractor)
+ {
+ Objects.requireNonNull(keyExtractor);
+ return (Comparator & Serializable)
+ (c1, c2) -> keyExtractor.apply(c1).compareTo(keyExtractor.apply(c2));
+ }
+
+ /**
+ * Accepts a function that extracts an {@code int} sort key from a type
+ * {@code T}, and returns a {@code Comparator} that compares by that
+ * sort key.
+ *
+ *
The returned comparator is serializable if the specified function
+ * is also serializable.
+ *
+ * @param the type of element to be compared
+ * @param keyExtractor the function used to extract the integer sort key
+ * @return a comparator that compares by an extracted key
+ * @see #comparing(Function)
+ * @throws NullPointerException if the argument is null
+ * @since 1.8
+ */
+ public static Comparator comparing(ToIntFunction super T> keyExtractor) {
+ Objects.requireNonNull(keyExtractor);
+ return (Comparator & Serializable)
+ (c1, c2) -> Integer.compare(keyExtractor.applyAsInt(c1), keyExtractor.applyAsInt(c2));
+ }
+
+ /**
+ * Accepts a function that extracts a {@code long} sort key from a type
+ * {@code T}, and returns a {@code Comparator} that compares by that
+ * sort key.
+ *
+ *
The returned comparator is serializable if the specified function is
+ * also serializable.
+ *
+ * @param the type of element to be compared
+ * @param keyExtractor the function used to extract the long sort key
+ * @return a comparator that compares by an extracted key
+ * @see #comparing(Function)
+ * @throws NullPointerException if the argument is null
+ * @since 1.8
+ */
+ public static Comparator comparing(ToLongFunction super T> keyExtractor) {
+ Objects.requireNonNull(keyExtractor);
+ return (Comparator & Serializable)
+ (c1, c2) -> Long.compare(keyExtractor.applyAsLong(c1), keyExtractor.applyAsLong(c2));
+ }
+
+ /**
+ * Accepts a function that extracts a {@code double} sort key from a type
+ * {@code T}, and returns a {@code Comparator} that compares by that
+ * sort key.
+ *
+ *
The returned comparator is serializable if the specified function
+ * is also serializable.
+ *
+ * @param the type of element to be compared
+ * @param keyExtractor the function used to extract the double sort key
+ * @return a comparator that compares by an extracted key
+ * @see #comparing(Function)
+ * @throws NullPointerException if the argument is null
+ * @since 1.8
+ */
+ public static Comparator comparing(ToDoubleFunction super T> keyExtractor) {
+ Objects.requireNonNull(keyExtractor);
+ return (Comparator & Serializable)
+ (c1, c2) -> Double.compare(keyExtractor.applyAsDouble(c1), keyExtractor.applyAsDouble(c2));
}
}
diff --git a/src/share/classes/java/util/Comparators.java b/src/share/classes/java/util/Comparators.java
index 97b7412f5c9564856a46acc9057d9468b1c49e5a..a90383210854756b2589a16c9740abc3d6ee3cec 100644
--- a/src/share/classes/java/util/Comparators.java
+++ b/src/share/classes/java/util/Comparators.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -32,16 +32,9 @@ import java.util.function.ToIntFunction;
import java.util.function.ToLongFunction;
/**
- * This class consists of {@code static} utility methods for comparators. Mostly
- * factory method that returns a {@link Comparator}.
- *
- *
Unless otherwise noted, passing a {@code null} argument to a method in
- * this class will cause a {@link NullPointerException} to be thrown.
- *
- * @see Comparator
- * @since 1.8
+ * Package private supporting class for {@link Comparator}.
*/
-public class Comparators {
+class Comparators {
private Comparators() {
throw new AssertionError("no instances");
}
@@ -51,231 +44,55 @@ public class Comparators {
*
* @see Comparable
*/
- private enum NaturalOrderComparator implements Comparator> {
+ enum NaturalOrderComparator implements Comparator> {
INSTANCE;
@Override
public int compare(Comparable c1, Comparable c2) {
return c1.compareTo(c2);
}
- }
-
- /**
- * Returns a comparator that imposes the reverse of the natural
- * ordering.
- *
- *
The returned comparator is serializable.
- *
- * @param {@link Comparable} type
- *
- * @return A comparator that imposes the reverse of the natural
- * ordering on a collection of objects that implement
- * the {@link Comparable} interface.
- * @see Comparable
- */
- public static > Comparator reverseOrder() {
- return Collections.reverseOrder();
- }
-
- /**
- * Returns a comparator that imposes the reverse ordering of the specified
- * {@link Comparator}.
- *
- *
The returned comparator is serializable (assuming the specified
- * comparator is also serializable).
- *
- * @param the element type to be compared
- * @param cmp a comparator whose ordering is to be reversed by the returned
- * comparator
- * @return A comparator that imposes the reverse ordering of the
- * specified comparator.
- */
- public static Comparator reverseOrder(Comparator cmp) {
- Objects.requireNonNull(cmp);
- return Collections.reverseOrder(cmp);
- }
-
- /**
- * Gets a comparator compares {@link Comparable} type in natural order.
- *
- * @param {@link Comparable} type
- */
- public static > Comparator naturalOrder() {
- return (Comparator) NaturalOrderComparator.INSTANCE;
- }
-
- /**
- * Gets a comparator compares {@link Map.Entry} in natural order on key.
- *
- * @param {@link Comparable} key type
- * @param value type
- */
- public static , V> Comparator> naturalOrderKeys() {
- return (Comparator> & Serializable)
- (c1, c2) -> c1.getKey().compareTo(c2.getKey());
- }
-
- /**
- * Gets a comparator compares {@link Map.Entry} in natural order on value.
- *
- * @param key type
- * @param {@link Comparable} value type
- */
- public static > Comparator> naturalOrderValues() {
- return (Comparator> & Serializable)
- (c1, c2) -> c1.getValue().compareTo(c2.getValue());
- }
-
- /**
- * Gets a comparator compares {@link Map.Entry} by key using the given
- * {@link Comparator}.
- *
- *
The returned comparator is serializable assuming the specified
- * comparators are also serializable.
- *
- * @param key type
- * @param value type
- * @param cmp the key {@link Comparator}
- */
- public static Comparator> byKey(Comparator super K> cmp) {
- Objects.requireNonNull(cmp);
- return (Comparator> & Serializable)
- (c1, c2) -> cmp.compare(c1.getKey(), c2.getKey());
- }
-
- /**
- * Gets a comparator compares {@link Map.Entry} by value using the given
- * {@link Comparator}.
- *
- * @param key type
- * @param value type
- * @param cmp the value {@link Comparator}
- */
- public static Comparator> byValue(Comparator super V> cmp) {
- Objects.requireNonNull(cmp);
- return (Comparator> & Serializable)
- (c1, c2) -> cmp.compare(c1.getValue(), c2.getValue());
- }
- /**
- * Accepts a function that extracts a {@link java.lang.Comparable
- * Comparable} sort key from a type {@code T}, and returns a {@code
- * Comparator} that compares by that sort key. For example, if a class
- * {@code Person} has a {@code String}-valued getter {@code getLastName},
- * then {@code comparing(Person::getLastName)} would return a {@code
- * Comparator} that compares {@code Person} objects by their last
- * name.
- *
- * @param the original element type
- * @param the {@link Comparable} type for comparison
- * @param keyExtractor the function used to extract the {@link Comparable} sort key
- */
- public static > Comparator comparing(Function super T, ? extends U> keyExtractor) {
- Objects.requireNonNull(keyExtractor);
- return (Comparator & Serializable)
- (c1, c2) -> keyExtractor.apply(c1).compareTo(keyExtractor.apply(c2));
- }
-
- /**
- * Accepts a function that extracts an {@code int} value from a type {@code
- * T}, and returns a {@code Comparator} that compares by that value.
- *
- *