From 642e0ac6f10c9c3ba9ddb827f4a9d6aa5d173f73 Mon Sep 17 00:00:00 2001 From: Roger Riggs Date: Mon, 27 Apr 2015 16:31:47 -0400 Subject: [PATCH 1/7] 8078369: [testbug] java/time/tck/java/time/TCKOffsetTime[now] fails on slow devices Increase the tolerance between successive calls to now() to 20sec Reviewed-by: scolebourne, sherman, dfuchs --- .../java/time/tck/java/time/TCKLocalDateTime.java | 7 +++---- .../java/time/tck/java/time/TCKOffsetDateTime.java | 9 ++++----- jdk/test/java/time/tck/java/time/TCKOffsetTime.java | 13 +++++++++---- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/jdk/test/java/time/tck/java/time/TCKLocalDateTime.java b/jdk/test/java/time/tck/java/time/TCKLocalDateTime.java index 51b1163dbca..93b385011d7 100644 --- a/jdk/test/java/time/tck/java/time/TCKLocalDateTime.java +++ b/jdk/test/java/time/tck/java/time/TCKLocalDateTime.java @@ -107,8 +107,6 @@ import static org.testng.Assert.assertSame; import static org.testng.Assert.assertTrue; import static org.testng.Assert.fail; -import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; import java.time.Clock; import java.time.DateTimeException; import java.time.DayOfWeek; @@ -260,16 +258,17 @@ public class TCKLocalDateTime extends AbstractDateTimeTest { //----------------------------------------------------------------------- @Test(timeOut=30000) // TODO: remove when time zone loading is faster public void now() { + final long DELTA = 20_000_000_000L; // 20 seconds of nanos leeway LocalDateTime expected = LocalDateTime.now(Clock.systemDefaultZone()); LocalDateTime test = LocalDateTime.now(); long diff = Math.abs(test.toLocalTime().toNanoOfDay() - expected.toLocalTime().toNanoOfDay()); - if (diff >= 100000000) { + if (diff >= DELTA) { // may be date change expected = LocalDateTime.now(Clock.systemDefaultZone()); test = LocalDateTime.now(); diff = Math.abs(test.toLocalTime().toNanoOfDay() - expected.toLocalTime().toNanoOfDay()); } - assertTrue(diff < 100000000); // less than 0.1 secs + assertTrue(diff < DELTA); } //----------------------------------------------------------------------- diff --git a/jdk/test/java/time/tck/java/time/TCKOffsetDateTime.java b/jdk/test/java/time/tck/java/time/TCKOffsetDateTime.java index b77b7a8ba15..991b447a506 100644 --- a/jdk/test/java/time/tck/java/time/TCKOffsetDateTime.java +++ b/jdk/test/java/time/tck/java/time/TCKOffsetDateTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -104,8 +104,6 @@ import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; import static org.testng.Assert.fail; -import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.time.Clock; @@ -235,16 +233,17 @@ public class TCKOffsetDateTime extends AbstractDateTimeTest { //----------------------------------------------------------------------- @Test public void now() { + final long DELTA = 20_000_000_000L; // 20 seconds of nanos leeway OffsetDateTime expected = OffsetDateTime.now(Clock.systemDefaultZone()); OffsetDateTime test = OffsetDateTime.now(); long diff = Math.abs(test.toLocalTime().toNanoOfDay() - expected.toLocalTime().toNanoOfDay()); - if (diff >= 100000000) { + if (diff >= DELTA) { // may be date change expected = OffsetDateTime.now(Clock.systemDefaultZone()); test = OffsetDateTime.now(); diff = Math.abs(test.toLocalTime().toNanoOfDay() - expected.toLocalTime().toNanoOfDay()); } - assertTrue(diff < 100000000); // less than 0.1 secs + assertTrue(diff < DELTA); } //----------------------------------------------------------------------- diff --git a/jdk/test/java/time/tck/java/time/TCKOffsetTime.java b/jdk/test/java/time/tck/java/time/TCKOffsetTime.java index d373be443f3..0882dfcb19e 100644 --- a/jdk/test/java/time/tck/java/time/TCKOffsetTime.java +++ b/jdk/test/java/time/tck/java/time/TCKOffsetTime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -89,8 +89,6 @@ import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertTrue; import static org.testng.Assert.fail; -import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.time.Clock; @@ -202,12 +200,19 @@ public class TCKOffsetTime extends AbstractDateTimeTest { //----------------------------------------------------------------------- @Test public void now() { + final long DELTA = 20_000_000_000L; // 20 seconds of nanos leeway ZonedDateTime nowDT = ZonedDateTime.now(); OffsetTime expected = OffsetTime.now(Clock.systemDefaultZone()); OffsetTime test = OffsetTime.now(); long diff = Math.abs(test.toLocalTime().toNanoOfDay() - expected.toLocalTime().toNanoOfDay()); - assertTrue(diff < 100000000); // less than 0.1 secs + if (diff >= DELTA) { + // may be date change + expected = OffsetTime.now(Clock.systemDefaultZone()); + test = OffsetTime.now(); + diff = Math.abs(test.toLocalTime().toNanoOfDay() - expected.toLocalTime().toNanoOfDay()); + } + assertTrue(diff < DELTA); assertEquals(test.getOffset(), nowDT.getOffset()); } From 41b36c4295d4af56e16fc6375f5d88bca642c134 Mon Sep 17 00:00:00 2001 From: Roger Riggs Date: Tue, 28 Apr 2015 09:28:24 -0400 Subject: [PATCH 2/7] 8078826: Add diagnostic info for java/lang/Runtime/exec/LotsOfOutput.java fails intermittently Add debugging output for diagnose intermittent failure Reviewed-by: chegar, joehw --- jdk/test/java/lang/Runtime/exec/LotsOfOutput.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jdk/test/java/lang/Runtime/exec/LotsOfOutput.java b/jdk/test/java/lang/Runtime/exec/LotsOfOutput.java index 2f8e594f2b6..b75f8e89eb1 100644 --- a/jdk/test/java/lang/Runtime/exec/LotsOfOutput.java +++ b/jdk/test/java/lang/Runtime/exec/LotsOfOutput.java @@ -41,7 +41,12 @@ public class LotsOfOutput { long initMemory = Runtime.getRuntime().totalMemory(); for (int i=1; i< 10; i++) { Thread.sleep(100); - if (Runtime.getRuntime().totalMemory() > initMemory + 1000000) + long totalMemory = Runtime.getRuntime().totalMemory(); + if (totalMemory != initMemory) { + System.out.printf("consuming memory: i: %d, initial: %d, total: %d, delta: %d%n", + i, initMemory, totalMemory, totalMemory - initMemory); + } + if (totalMemory > initMemory + 1000000) throw new Exception("Process consumes memory."); } From d44ef60eb07b8bb49151e8930a2453e036b3c9e4 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Tue, 28 Apr 2015 10:12:15 -0700 Subject: [PATCH 3/7] 8024086: (fs) AtomicMoveNotSupportedException allows reason to be null Modify javadoc specification of 'reason' parameter to allow null Reviewed-by: alanb --- .../classes/java/nio/file/AtomicMoveNotSupportedException.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/src/java.base/share/classes/java/nio/file/AtomicMoveNotSupportedException.java b/jdk/src/java.base/share/classes/java/nio/file/AtomicMoveNotSupportedException.java index 27947c31a8c..5849565330e 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/AtomicMoveNotSupportedException.java +++ b/jdk/src/java.base/share/classes/java/nio/file/AtomicMoveNotSupportedException.java @@ -45,7 +45,7 @@ public class AtomicMoveNotSupportedException * @param target * a string identifying the target file or {@code null} if not known * @param reason - * a reason message with additional information + * a reason message with additional information or {@code null} */ public AtomicMoveNotSupportedException(String source, String target, From 0bdbfa87dc54c423cd937900a97b87aa30544d4d Mon Sep 17 00:00:00 2001 From: Alexander Stepanov Date: Tue, 28 Apr 2015 21:30:10 +0400 Subject: [PATCH 4/7] 8076224: some tidy warnings from core libs Minor HTML markup fix Reviewed-by: rriggs, lancea --- .../share/classes/java/lang/Runtime.java | 252 +++++++++--------- .../java/util/JapaneseImperialCalendar.java | 76 +++--- .../classes/jdk/net/NetworkPermission.java | 2 +- .../management/DiagnosticCommandMBean.java | 4 +- .../GarbageCollectionNotificationInfo.java | 6 +- .../classes/com/sun/management/GcInfo.java | 39 ++- .../classes/com/sun/management/VMOption.java | 48 ++-- .../attach/AgentInitializationException.java | 26 +- .../sun/tools/attach/spi/AttachProvider.java | 81 +++--- .../com/sun/net/httpserver/Filter.java | 13 +- .../com/sun/net/httpserver/Headers.java | 13 +- .../com/sun/net/httpserver/HttpExchange.java | 24 +- .../com/sun/net/httpserver/HttpServer.java | 8 +- .../sun/net/httpserver/HttpsConfigurator.java | 8 +- .../com/sun/net/httpserver/package-info.java | 8 +- 15 files changed, 304 insertions(+), 304 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/lang/Runtime.java b/jdk/src/java.base/share/classes/java/lang/Runtime.java index 114f6cb968f..e75fcb439cf 100644 --- a/jdk/src/java.base/share/classes/java/lang/Runtime.java +++ b/jdk/src/java.base/share/classes/java/lang/Runtime.java @@ -32,9 +32,9 @@ import sun.reflect.Reflection; /** * Every Java application has a single instance of class - * Runtime that allows the application to interface with + * {@code Runtime} that allows the application to interface with * the environment in which the application is running. The current - * runtime can be obtained from the getRuntime method. + * runtime can be obtained from the {@code getRuntime} method. *

* An application cannot create its own instance of this class. * @@ -48,10 +48,10 @@ public class Runtime { /** * Returns the runtime object associated with the current Java application. - * Most of the methods of class Runtime are instance + * Most of the methods of class {@code Runtime} are instance * methods and must be invoked with respect to the current runtime object. * - * @return the Runtime object associated with the current + * @return the {@code Runtime} object associated with the current * Java application. */ public static Runtime getRuntime() { @@ -72,8 +72,7 @@ public class Runtime { * if any, are started in some unspecified order and allowed to run * concurrently until they finish. In the second phase all uninvoked * finalizers are run if {@link #runFinalizersOnExit finalization-on-exit} - * has been enabled. Once this is done the virtual machine {@link #halt - * halts}. + * has been enabled. Once this is done the virtual machine {@link #halt halts}. * *

If this method is invoked after the virtual machine has begun its * shutdown sequence then if shutdown hooks are being run this method will @@ -82,7 +81,7 @@ public class Runtime { * with the given status code if the status is nonzero; otherwise, it * blocks indefinitely. * - *

The {@link System#exit(int) System.exit} method is the + *

The {@link System#exit(int) System.exit} method is the * conventional and convenient means of invoking this method. * * @param status @@ -90,8 +89,8 @@ public class Runtime { * indicates abnormal termination. * * @throws SecurityException - * If a security manager is present and its {@link - * SecurityManager#checkExit checkExit} method does not permit + * If a security manager is present and its + * {@link SecurityManager#checkExit checkExit} method does not permit * exiting with the specified status * * @see java.lang.SecurityException @@ -118,11 +117,11 @@ public class Runtime { *

    * *
  • The program exits normally, when the last non-daemon - * thread exits or when the {@link #exit exit} (equivalently, + * thread exits or when the {@link #exit exit} (equivalently, * {@link System#exit(int) System.exit}) method is invoked, or * *
  • The virtual machine is terminated in response to a - * user interrupt, such as typing ^C, or a system-wide event, + * user interrupt, such as typing {@code ^C}, or a system-wide event, * such as user logoff or system shutdown. * *
@@ -134,17 +133,16 @@ public class Runtime { * run all uninvoked finalizers if finalization-on-exit has been enabled. * Finally, the virtual machine will halt. Note that daemon threads will * continue to run during the shutdown sequence, as will non-daemon threads - * if shutdown was initiated by invoking the {@link #exit exit} - * method. + * if shutdown was initiated by invoking the {@link #exit exit} method. * *

Once the shutdown sequence has begun it can be stopped only by - * invoking the {@link #halt halt} method, which forcibly + * invoking the {@link #halt halt} method, which forcibly * terminates the virtual machine. * *

Once the shutdown sequence has begun it is impossible to register a * new shutdown hook or de-register a previously-registered hook. * Attempting either of these operations will cause an - * {@link IllegalStateException} to be thrown. + * {@link IllegalStateException} to be thrown. * *

Shutdown hooks run at a delicate time in the life cycle of a virtual * machine and should therefore be coded defensively. They should, in @@ -156,7 +154,7 @@ public class Runtime { * deadlocks. * *

Shutdown hooks should also finish their work quickly. When a - * program invokes {@link #exit exit} the expectation is + * program invokes {@link #exit exit} the expectation is * that the virtual machine will promptly shut down and exit. When the * virtual machine is terminated due to user logoff or system shutdown the * underlying operating system may only allow a fixed amount of time in @@ -165,17 +163,17 @@ public class Runtime { * hook. * *

Uncaught exceptions are handled in shutdown hooks just as in any - * other thread, by invoking the {@link ThreadGroup#uncaughtException - * uncaughtException} method of the thread's {@link - * ThreadGroup} object. The default implementation of this method - * prints the exception's stack trace to {@link System#err} and + * other thread, by invoking the + * {@link ThreadGroup#uncaughtException uncaughtException} method of the + * thread's {@link ThreadGroup} object. The default implementation of this + * method prints the exception's stack trace to {@link System#err} and * terminates the thread; it does not cause the virtual machine to exit or * halt. * *

In rare circumstances the virtual machine may abort, that is, * stop running without shutting down cleanly. This occurs when the * virtual machine is terminated externally, for example with the - * SIGKILL signal on Unix or the TerminateProcess call on + * {@code SIGKILL} signal on Unix or the {@code TerminateProcess} call on * Microsoft Windows. The virtual machine may also abort if a native * method goes awry by, for example, corrupting internal data structures or * attempting to access nonexistent memory. If the virtual machine aborts @@ -183,7 +181,7 @@ public class Runtime { * will be run. * * @param hook - * An initialized but unstarted {@link Thread} object + * An initialized but unstarted {@link Thread} object * * @throws IllegalArgumentException * If the specified hook has already been registered, @@ -196,7 +194,7 @@ public class Runtime { * * @throws SecurityException * If a security manager is present and it denies - * {@link RuntimePermission}("shutdownHooks") + * {@link RuntimePermission}("shutdownHooks") * * @see #removeShutdownHook * @see #halt(int) @@ -212,11 +210,11 @@ public class Runtime { } /** - * De-registers a previously-registered virtual-machine shutdown hook.

+ * De-registers a previously-registered virtual-machine shutdown hook. * * @param hook the hook to remove - * @return true if the specified hook had previously been - * registered and was successfully de-registered, false + * @return {@code true} if the specified hook had previously been + * registered and was successfully de-registered, {@code false} * otherwise. * * @throws IllegalStateException @@ -225,7 +223,7 @@ public class Runtime { * * @throws SecurityException * If a security manager is present and it denies - * {@link RuntimePermission}("shutdownHooks") + * {@link RuntimePermission}("shutdownHooks") * * @see #addShutdownHook * @see #exit(int) @@ -244,23 +242,23 @@ public class Runtime { * method never returns normally. * *

This method should be used with extreme caution. Unlike the - * {@link #exit exit} method, this method does not cause shutdown + * {@link #exit exit} method, this method does not cause shutdown * hooks to be started and does not run uninvoked finalizers if * finalization-on-exit has been enabled. If the shutdown sequence has * already been initiated then this method does not wait for any running * shutdown hooks or finalizers to finish their work. * * @param status - * Termination status. By convention, a nonzero status code - * indicates abnormal termination. If the {@link Runtime#exit - * exit} (equivalently, {@link System#exit(int) - * System.exit}) method has already been invoked then this - * status code will override the status code passed to that method. + * Termination status. By convention, a nonzero status code + * indicates abnormal termination. If the {@link Runtime#exit exit} + * (equivalently, {@link System#exit(int) System.exit}) method + * has already been invoked then this status code + * will override the status code passed to that method. * * @throws SecurityException - * If a security manager is present and its {@link - * SecurityManager#checkExit checkExit} method does not permit - * an exit with the specified status + * If a security manager is present and its + * {@link SecurityManager#checkExit checkExit} method + * does not permit an exit with the specified status * * @see #exit * @see #addShutdownHook @@ -282,7 +280,7 @@ public class Runtime { * By default, finalization on exit is disabled. * *

If there is a security manager, - * its checkExit method is first called + * its {@code checkExit} method is first called * with 0 as its argument to ensure the exit is allowed. * This could result in a SecurityException. * @@ -293,7 +291,7 @@ public class Runtime { * behavior or deadlock. * * @throws SecurityException - * if a security manager exists and its checkExit + * if a security manager exists and its {@code checkExit} * method doesn't allow the exit. * * @see java.lang.Runtime#exit(int) @@ -318,9 +316,9 @@ public class Runtime { * Executes the specified string command in a separate process. * *

This is a convenience method. An invocation of the form - * exec(command) + * {@code exec(command)} * behaves in exactly the same way as the invocation - * {@link #exec(String, String[], File) exec}(command, null, null). + * {@link #exec(String, String[], File) exec}{@code (command, null, null)}. * * @param command a specified system command. * @@ -335,10 +333,10 @@ public class Runtime { * If an I/O error occurs * * @throws NullPointerException - * If command is null + * If {@code command} is {@code null} * * @throws IllegalArgumentException - * If command is empty + * If {@code command} is empty * * @see #exec(String[], String[], File) * @see ProcessBuilder @@ -352,16 +350,16 @@ public class Runtime { * specified environment. * *

This is a convenience method. An invocation of the form - * exec(command, envp) + * {@code exec(command, envp)} * behaves in exactly the same way as the invocation - * {@link #exec(String, String[], File) exec}(command, envp, null). + * {@link #exec(String, String[], File) exec}{@code (command, envp, null)}. * * @param command a specified system command. * * @param envp array of strings, each element of which * has environment variable settings in the format * name=value, or - * null if the subprocess should inherit + * {@code null} if the subprocess should inherit * the environment of the current process. * * @return A new {@link Process} object for managing the subprocess @@ -375,11 +373,11 @@ public class Runtime { * If an I/O error occurs * * @throws NullPointerException - * If command is null, - * or one of the elements of envp is null + * If {@code command} is {@code null}, + * or one of the elements of {@code envp} is {@code null} * * @throws IllegalArgumentException - * If command is empty + * If {@code command} is empty * * @see #exec(String[], String[], File) * @see ProcessBuilder @@ -393,29 +391,29 @@ public class Runtime { * specified environment and working directory. * *

This is a convenience method. An invocation of the form - * exec(command, envp, dir) + * {@code exec(command, envp, dir)} * behaves in exactly the same way as the invocation - * {@link #exec(String[], String[], File) exec}(cmdarray, envp, dir), - * where cmdarray is an array of all the tokens in - * command. + * {@link #exec(String[], String[], File) exec}{@code (cmdarray, envp, dir)}, + * where {@code cmdarray} is an array of all the tokens in + * {@code command}. * - *

More precisely, the command string is broken + *

More precisely, the {@code command} string is broken * into tokens using a {@link StringTokenizer} created by the call - * new {@link StringTokenizer}(command) with no + * {@code new {@link StringTokenizer}(command)} with no * further modification of the character categories. The tokens * produced by the tokenizer are then placed in the new string - * array cmdarray, in the same order. + * array {@code cmdarray}, in the same order. * * @param command a specified system command. * * @param envp array of strings, each element of which * has environment variable settings in the format * name=value, or - * null if the subprocess should inherit + * {@code null} if the subprocess should inherit * the environment of the current process. * * @param dir the working directory of the subprocess, or - * null if the subprocess should inherit + * {@code null} if the subprocess should inherit * the working directory of the current process. * * @return A new {@link Process} object for managing the subprocess @@ -429,11 +427,11 @@ public class Runtime { * If an I/O error occurs * * @throws NullPointerException - * If command is null, - * or one of the elements of envp is null + * If {@code command} is {@code null}, + * or one of the elements of {@code envp} is {@code null} * * @throws IllegalArgumentException - * If command is empty + * If {@code command} is empty * * @see ProcessBuilder * @since 1.3 @@ -454,9 +452,9 @@ public class Runtime { * Executes the specified command and arguments in a separate process. * *

This is a convenience method. An invocation of the form - * exec(cmdarray) + * {@code exec(cmdarray)} * behaves in exactly the same way as the invocation - * {@link #exec(String[], String[], File) exec}(cmdarray, null, null). + * {@link #exec(String[], String[], File) exec}{@code (cmdarray, null, null)}. * * @param cmdarray array containing the command to call and * its arguments. @@ -472,12 +470,12 @@ public class Runtime { * If an I/O error occurs * * @throws NullPointerException - * If cmdarray is null, - * or one of the elements of cmdarray is null + * If {@code cmdarray} is {@code null}, + * or one of the elements of {@code cmdarray} is {@code null} * * @throws IndexOutOfBoundsException - * If cmdarray is an empty array - * (has length 0) + * If {@code cmdarray} is an empty array + * (has length {@code 0}) * * @see ProcessBuilder */ @@ -490,9 +488,9 @@ public class Runtime { * with the specified environment. * *

This is a convenience method. An invocation of the form - * exec(cmdarray, envp) + * {@code exec(cmdarray, envp)} * behaves in exactly the same way as the invocation - * {@link #exec(String[], String[], File) exec}(cmdarray, envp, null). + * {@link #exec(String[], String[], File) exec}{@code (cmdarray, envp, null)}. * * @param cmdarray array containing the command to call and * its arguments. @@ -500,7 +498,7 @@ public class Runtime { * @param envp array of strings, each element of which * has environment variable settings in the format * name=value, or - * null if the subprocess should inherit + * {@code null} if the subprocess should inherit * the environment of the current process. * * @return A new {@link Process} object for managing the subprocess @@ -514,13 +512,13 @@ public class Runtime { * If an I/O error occurs * * @throws NullPointerException - * If cmdarray is null, - * or one of the elements of cmdarray is null, - * or one of the elements of envp is null + * If {@code cmdarray} is {@code null}, + * or one of the elements of {@code cmdarray} is {@code null}, + * or one of the elements of {@code envp} is {@code null} * * @throws IndexOutOfBoundsException - * If cmdarray is an empty array - * (has length 0) + * If {@code cmdarray} is an empty array + * (has length {@code 0}) * * @see ProcessBuilder */ @@ -533,17 +531,17 @@ public class Runtime { * Executes the specified command and arguments in a separate process with * the specified environment and working directory. * - *

Given an array of strings cmdarray, representing the - * tokens of a command line, and an array of strings envp, + *

Given an array of strings {@code cmdarray}, representing the + * tokens of a command line, and an array of strings {@code envp}, * representing "environment" variable settings, this method creates * a new process in which to execute the specified command. * - *

This method checks that cmdarray is a valid operating + *

This method checks that {@code cmdarray} is a valid operating * system command. Which commands are valid is system-dependent, * but at the very least the command must be a non-empty list of * non-null strings. * - *

If envp is null, the subprocess inherits the + *

If {@code envp} is {@code null}, the subprocess inherits the * environment settings of the current process. * *

A minimal set of system dependent environment variables may @@ -554,14 +552,14 @@ public class Runtime { *

{@link ProcessBuilder#start()} is now the preferred way to * start a process with a modified environment. * - *

The working directory of the new subprocess is specified by dir. - * If dir is null, the subprocess inherits the + *

The working directory of the new subprocess is specified by {@code dir}. + * If {@code dir} is {@code null}, the subprocess inherits the * current working directory of the current process. * *

If a security manager exists, its * {@link SecurityManager#checkExec checkExec} * method is invoked with the first component of the array - * cmdarray as its argument. This may result in a + * {@code cmdarray} as its argument. This may result in a * {@link SecurityException} being thrown. * *

Starting an operating system process is highly system-dependent. @@ -586,11 +584,11 @@ public class Runtime { * @param envp array of strings, each element of which * has environment variable settings in the format * name=value, or - * null if the subprocess should inherit + * {@code null} if the subprocess should inherit * the environment of the current process. * * @param dir the working directory of the subprocess, or - * null if the subprocess should inherit + * {@code null} if the subprocess should inherit * the working directory of the current process. * * @return A new {@link Process} object for managing the subprocess @@ -607,13 +605,13 @@ public class Runtime { * If an I/O error occurs * * @throws NullPointerException - * If cmdarray is null, - * or one of the elements of cmdarray is null, - * or one of the elements of envp is null + * If {@code cmdarray} is {@code null}, + * or one of the elements of {@code cmdarray} is {@code null}, + * or one of the elements of {@code envp} is {@code null} * * @throws IndexOutOfBoundsException - * If cmdarray is an empty array - * (has length 0) + * If {@code cmdarray} is an empty array + * (has length {@code 0}) * * @see ProcessBuilder * @since 1.3 @@ -643,8 +641,8 @@ public class Runtime { /** * Returns the amount of free memory in the Java Virtual Machine. * Calling the - * gc method may result in increasing the value returned - * by freeMemory. + * {@code gc} method may result in increasing the value returned + * by {@code freeMemory.} * * @return an approximation to the total amount of memory currently * available for future allocated objects, measured in bytes. @@ -665,9 +663,9 @@ public class Runtime { public native long totalMemory(); /** - * Returns the maximum amount of memory that the Java virtual machine will - * attempt to use. If there is no inherent limit then the value {@link - * java.lang.Long#MAX_VALUE} will be returned. + * Returns the maximum amount of memory that the Java virtual machine + * will attempt to use. If there is no inherent limit then the value + * {@link java.lang.Long#MAX_VALUE} will be returned. * * @return the maximum amount of memory that the virtual machine will * attempt to use, measured in bytes @@ -683,10 +681,10 @@ public class Runtime { * returns from the method call, the virtual machine has made * its best effort to recycle all discarded objects. *

- * The name gc stands for "garbage + * The name {@code gc} stands for "garbage * collector". The virtual machine performs this recycling * process automatically as needed, in a separate thread, even if the - * gc method is not invoked explicitly. + * {@code gc} method is not invoked explicitly. *

* The method {@link System#gc()} is the conventional and convenient * means of invoking this method. @@ -699,15 +697,15 @@ public class Runtime { /** * Runs the finalization methods of any objects pending finalization. * Calling this method suggests that the Java virtual machine expend - * effort toward running the finalize methods of objects - * that have been found to be discarded but whose finalize + * effort toward running the {@code finalize} methods of objects + * that have been found to be discarded but whose {@code finalize} * methods have not yet been run. When control returns from the * method call, the virtual machine has made a best effort to * complete all outstanding finalizations. *

* The virtual machine performs the finalization process * automatically as needed, in a separate thread, if the - * runFinalization method is not invoked explicitly. + * {@code runFinalization} method is not invoked explicitly. *

* The method {@link System#runFinalization()} is the conventional * and convenient means of invoking this method. @@ -720,7 +718,7 @@ public class Runtime { /** * Enables/Disables tracing of instructions. - * If the boolean argument is true, this + * If the {@code boolean} argument is {@code true}, this * method suggests that the Java virtual machine emit debugging * information for each instruction in the virtual machine as it * is executed. The format of this information, and the file or other @@ -729,18 +727,18 @@ public class Runtime { * this feature. The destination of the trace output is system * dependent. *

- * If the boolean argument is false, this + * If the {@code boolean} argument is {@code false}, this * method causes the virtual machine to stop performing the * detailed instruction trace it is performing. * - * @param on true to enable instruction tracing; - * false to disable this feature. + * @param on {@code true} to enable instruction tracing; + * {@code false} to disable this feature. */ public void traceInstructions(boolean on) { } /** * Enables/Disables tracing of method calls. - * If the boolean argument is true, this + * If the {@code boolean} argument is {@code true}, this * method suggests that the Java virtual machine emit debugging * information for each method in the virtual machine as it is * called. The format of this information, and the file or other output @@ -751,8 +749,8 @@ public class Runtime { * Calling this method with argument false suggests that the * virtual machine cease emitting per-call debugging information. * - * @param on true to enable instruction tracing; - * false to disable this feature. + * @param on {@code true} to enable instruction tracing; + * {@code false} to disable this feature. */ public void traceMethodCalls(boolean on) { } @@ -760,7 +758,7 @@ public class Runtime { * Loads the native library specified by the filename argument. The filename * argument must be an absolute path name. * (for example - * Runtime.getRuntime().load("/home/avh/lib/libX11.so");). + * {@code Runtime.getRuntime().load("/home/avh/lib/libX11.so");}). * * If the filename argument, when stripped of any platform-specific library * prefix, path, and file extension, indicates a library whose name is, @@ -773,8 +771,8 @@ public class Runtime { * Otherwise, the filename argument is mapped to a native library image in * an implementation-dependent manner. *

- * First, if there is a security manager, its checkLink - * method is called with the filename as its argument. + * First, if there is a security manager, its {@code checkLink} + * method is called with the {@code filename} as its argument. * This may result in a security exception. *

* This is similar to the method {@link #loadLibrary(String)}, but it @@ -786,14 +784,14 @@ public class Runtime { * * @param filename the file to load. * @exception SecurityException if a security manager exists and its - * checkLink method doesn't allow + * {@code checkLink} method doesn't allow * loading of the specified dynamic library * @exception UnsatisfiedLinkError if either the filename is not an * absolute path name, the native library is not statically * linked with the VM, or the library cannot be mapped to * a native library image by the host system. - * @exception NullPointerException if filename is - * null + * @exception NullPointerException if {@code filename} is + * {@code null} * @see java.lang.Runtime#getRuntime() * @see java.lang.SecurityException * @see java.lang.SecurityManager#checkLink(java.lang.String) @@ -816,26 +814,26 @@ public class Runtime { } /** - * Loads the native library specified by the libname - * argument. The libname argument must not contain any platform + * Loads the native library specified by the {@code libname} + * argument. The {@code libname} argument must not contain any platform * specific prefix, file extension or path. If a native library - * called libname is statically linked with the VM, then the - * JNI_OnLoad_libname function exported by the library is invoked. + * called {@code libname} is statically linked with the VM, then the + * JNI_OnLoad_{@code libname} function exported by the library is invoked. * See the JNI Specification for more details. * * Otherwise, the libname argument is loaded from a system library * location and mapped to a native library image in an implementation- * dependent manner. *

- * First, if there is a security manager, its checkLink - * method is called with the libname as its argument. + * First, if there is a security manager, its {@code checkLink} + * method is called with the {@code libname} as its argument. * This may result in a security exception. *

* The method {@link System#loadLibrary(String)} is the conventional * and convenient means of invoking this method. If native * methods are to be used in the implementation of a class, a standard * strategy is to put the native code in a library file (call it - * LibFile) and then to put a static initializer: + * {@code LibFile}) and then to put a static initializer: *

      * static { System.loadLibrary("LibFile"); }
      * 
@@ -848,14 +846,14 @@ public class Runtime { * * @param libname the name of the library. * @exception SecurityException if a security manager exists and its - * checkLink method doesn't allow + * {@code checkLink} method doesn't allow * loading of the specified dynamic library * @exception UnsatisfiedLinkError if either the libname argument * contains a file path, the native library is not statically * linked with the VM, or the library cannot be mapped to a * native library image by the host system. - * @exception NullPointerException if libname is - * null + * @exception NullPointerException if {@code libname} is + * {@code null} * @see java.lang.SecurityException * @see java.lang.SecurityManager#checkLink(java.lang.String) */ @@ -878,7 +876,7 @@ public class Runtime { /** * Creates a localized version of an input stream. This method takes - * an InputStream and returns an InputStream + * an {@code InputStream} and returns an {@code InputStream} * equivalent to the argument in all respects except that it is * localized: as characters in the local character set are read from * the stream, they are automatically converted from the local @@ -894,7 +892,7 @@ public class Runtime { * @see java.io.InputStreamReader#InputStreamReader(java.io.InputStream) * @deprecated As of JDK 1.1, the preferred way to translate a byte * stream in the local encoding into a character stream in Unicode is via - * the InputStreamReader and BufferedReader + * the {@code InputStreamReader} and {@code BufferedReader} * classes. */ @Deprecated @@ -904,8 +902,8 @@ public class Runtime { /** * Creates a localized version of an output stream. This method - * takes an OutputStream and returns an - * OutputStream equivalent to the argument in all respects + * takes an {@code OutputStream} and returns an + * {@code OutputStream} equivalent to the argument in all respects * except that it is localized: as Unicode characters are written to * the stream, they are automatically converted to the local * character set. @@ -915,8 +913,8 @@ public class Runtime { * * @deprecated As of JDK 1.1, the preferred way to translate a * Unicode character stream into a byte stream in the local encoding is via - * the OutputStreamWriter, BufferedWriter, and - * PrintWriter classes. + * the {@code OutputStreamWriter}, {@code BufferedWriter}, and + * {@code PrintWriter} classes. * * @param out OutputStream to localize * @return a localized output stream diff --git a/jdk/src/java.base/share/classes/java/util/JapaneseImperialCalendar.java b/jdk/src/java.base/share/classes/java/util/JapaneseImperialCalendar.java index c66518a5cc4..844a5a2923c 100644 --- a/jdk/src/java.base/share/classes/java/util/JapaneseImperialCalendar.java +++ b/jdk/src/java.base/share/classes/java/util/JapaneseImperialCalendar.java @@ -53,9 +53,9 @@ import sun.util.calendar.ZoneInfo; * ------------------------------------------------------ * } * - *

ERA value 0 specifies the years before Meiji and - * the Gregorian year values are used. Unlike {@link - * GregorianCalendar}, the Julian to Gregorian transition is not + *

{@code ERA} value 0 specifies the years before Meiji and + * the Gregorian year values are used. Unlike + * {@link GregorianCalendar}, the Julian to Gregorian transition is not * supported because it doesn't make any sense to the Japanese * calendar systems used before Meiji. To represent the years before * Gregorian year 1, 0 and negative values are used. The Japanese @@ -66,7 +66,7 @@ import sun.util.calendar.ZoneInfo; *

A new era can be specified using property * jdk.calendar.japanese.supplemental.era. The new era is added to the * predefined eras. The syntax of the property is as follows. - *

+ * 
  *   {@code name=,abbr=,since=}
  * 
* where @@ -83,7 +83,7 @@ import sun.util.calendar.ZoneInfo; * ignored. * *

The following is an example of the property usage. - *

+ * 
  *   java -Djdk.calendar.japanese.supplemental.era="name=NewEra,abbr=N,since=253374307200000"
  * 
* The property specifies an era change to NewEra at 9999-02-11T00:00:00 local time. @@ -315,7 +315,7 @@ class JapaneseImperialCalendar extends Calendar { private transient int[] originalFields; /** - * Constructs a JapaneseImperialCalendar based on the current time + * Constructs a {@code JapaneseImperialCalendar} based on the current time * in the given time zone with the given locale. * * @param zone the given time zone. @@ -351,16 +351,16 @@ class JapaneseImperialCalendar extends Calendar { } /** - * Compares this JapaneseImperialCalendar to the specified - * Object. The result is true if and - * only if the argument is a JapaneseImperialCalendar object + * Compares this {@code JapaneseImperialCalendar} to the specified + * {@code Object}. The result is {@code true} if and + * only if the argument is a {@code JapaneseImperialCalendar} object * that represents the same time value (millisecond offset from * the Epoch) under the same - * Calendar parameters. + * {@code Calendar} parameters. * * @param obj the object to compare with. - * @return true if this object is equal to obj; - * false otherwise. + * @return {@code true} if this object is equal to {@code obj}; + * {@code false} otherwise. * @see Calendar#compareTo(Calendar) */ @Override @@ -371,7 +371,7 @@ class JapaneseImperialCalendar extends Calendar { /** * Generates the hash code for this - * JapaneseImperialCalendar object. + * {@code JapaneseImperialCalendar} object. */ @Override public int hashCode() { @@ -382,27 +382,27 @@ class JapaneseImperialCalendar extends Calendar { * Adds the specified (signed) amount of time to the given calendar field, * based on the calendar's rules. * - *

Add rule 1. The value of field - * after the call minus the value of field before the - * call is amount, modulo any overflow that has occurred in - * field. Overflow occurs when a field value exceeds its + *

Add rule 1. The value of {@code field} + * after the call minus the value of {@code field} before the + * call is {@code amount}, modulo any overflow that has occurred in + * {@code field}. Overflow occurs when a field value exceeds its * range and, as a result, the next larger field is incremented or * decremented and the field value is adjusted back into its range.

* *

Add rule 2. If a smaller field is expected to be * invariant, but it is impossible for it to be equal to its * prior value because of changes in its minimum or maximum after - * field is changed, then its value is adjusted to be as close + * {@code field} is changed, then its value is adjusted to be as close * as possible to its expected value. A smaller field represents a - * smaller unit of time. HOUR is a smaller field than - * DAY_OF_MONTH. No adjustment is made to smaller fields + * smaller unit of time. {@code HOUR} is a smaller field than + * {@code DAY_OF_MONTH}. No adjustment is made to smaller fields * that are not expected to be invariant. The calendar system * determines what fields are expected to be invariant.

* * @param field the calendar field. * @param amount the amount of date or time to be added to the field. - * @exception IllegalArgumentException if field is - * ZONE_OFFSET, DST_OFFSET, or unknown, + * @exception IllegalArgumentException if {@code field} is + * {@code ZONE_OFFSET}, {@code DST_OFFSET}, or unknown, * or if any calendar fields have out-of-range values in * non-lenient mode. */ @@ -548,12 +548,12 @@ class JapaneseImperialCalendar extends Calendar { *

This method calls {@link #complete()} before adding the * amount so that all the calendar fields are normalized. If there * is any calendar field having an out-of-range value in non-lenient mode, then an - * IllegalArgumentException is thrown. + * {@code IllegalArgumentException} is thrown. * * @param field the calendar field. - * @param amount the signed amount to add to field. - * @exception IllegalArgumentException if field is - * ZONE_OFFSET, DST_OFFSET, or unknown, + * @param amount the signed amount to add to {@code field}. + * @exception IllegalArgumentException if {@code field} is + * {@code ZONE_OFFSET}, {@code DST_OFFSET}, or unknown, * or if any calendar fields have out-of-range values in * non-lenient mode. * @see #roll(int,boolean) @@ -1055,9 +1055,9 @@ class JapaneseImperialCalendar extends Calendar { /** * Returns the minimum value for the given calendar field of this - * Calendar instance. The minimum value is - * defined as the smallest value returned by the {@link - * Calendar#get(int) get} method for any possible time value, + * {@code Calendar} instance. The minimum value is + * defined as the smallest value returned by the + * {@link Calendar#get(int) get} method for any possible time value, * taking into consideration the current values of the * {@link Calendar#getFirstDayOfWeek() getFirstDayOfWeek}, * {@link Calendar#getMinimalDaysInFirstWeek() getMinimalDaysInFirstWeek}, @@ -1077,9 +1077,9 @@ class JapaneseImperialCalendar extends Calendar { /** * Returns the maximum value for the given calendar field of this - * GregorianCalendar instance. The maximum value is - * defined as the largest value returned by the {@link - * Calendar#get(int) get} method for any possible time value, + * {@code GregorianCalendar} instance. The maximum value is + * defined as the largest value returned by the + * {@link Calendar#get(int) get} method for any possible time value, * taking into consideration the current values of the * {@link Calendar#getFirstDayOfWeek() getFirstDayOfWeek}, * {@link Calendar#getMinimalDaysInFirstWeek() getMinimalDaysInFirstWeek}, @@ -1108,7 +1108,7 @@ class JapaneseImperialCalendar extends Calendar { /** * Returns the highest minimum value for the given calendar field - * of this GregorianCalendar instance. The highest + * of this {@code GregorianCalendar} instance. The highest * minimum value is defined as the largest value returned by * {@link #getActualMinimum(int)} for any possible time value, * taking into consideration the current values of the @@ -1130,7 +1130,7 @@ class JapaneseImperialCalendar extends Calendar { /** * Returns the lowest maximum value for the given calendar field - * of this GregorianCalendar instance. The lowest + * of this {@code GregorianCalendar} instance. The lowest * maximum value is defined as the smallest value returned by * {@link #getActualMaximum(int)} for any possible time value, * taking into consideration the current values of the @@ -1166,7 +1166,7 @@ class JapaneseImperialCalendar extends Calendar { * * @param field the calendar field * @return the minimum of the given field for the time value of - * this JapaneseImperialCalendar + * this {@code JapaneseImperialCalendar} * @see #getMinimum(int) * @see #getMaximum(int) * @see #getGreatestMinimum(int) @@ -1269,13 +1269,13 @@ class JapaneseImperialCalendar extends Calendar { * and * {@link Calendar#getTimeZone() getTimeZone} methods. * For example, if the date of this instance is Heisei 16February 1, - * the actual maximum value of the DAY_OF_MONTH field + * the actual maximum value of the {@code DAY_OF_MONTH} field * is 29 because Heisei 16 is a leap year, and if the date of this * instance is Heisei 17 February 1, it's 28. * * @param field the calendar field * @return the maximum of the given field for the time value of - * this JapaneseImperialCalendar + * this {@code JapaneseImperialCalendar} * @see #getMinimum(int) * @see #getMaximum(int) * @see #getGreatestMinimum(int) @@ -1558,7 +1558,7 @@ class JapaneseImperialCalendar extends Calendar { * href="Calendar.html#Epoch">Epoch) to calendar field values. * The time is not * recomputed first; to recompute the time, then the fields, call the - * complete method. + * {@code complete} method. * * @see Calendar#complete */ diff --git a/jdk/src/java.base/share/classes/jdk/net/NetworkPermission.java b/jdk/src/java.base/share/classes/jdk/net/NetworkPermission.java index 01aa1a89653..df740da8488 100644 --- a/jdk/src/java.base/share/classes/jdk/net/NetworkPermission.java +++ b/jdk/src/java.base/share/classes/jdk/net/NetworkPermission.java @@ -33,7 +33,7 @@ import java.security.BasicPermission; * name, but no actions list. Callers either possess the permission or not. *

* The following targets are defined: - *

+ * * * diff --git a/jdk/src/java.management/share/classes/com/sun/management/DiagnosticCommandMBean.java b/jdk/src/java.management/share/classes/com/sun/management/DiagnosticCommandMBean.java index 4534acda1e8..1d2a85e62b2 100644 --- a/jdk/src/java.management/share/classes/com/sun/management/DiagnosticCommandMBean.java +++ b/jdk/src/java.management/share/classes/com/sun/management/DiagnosticCommandMBean.java @@ -93,7 +93,7 @@ import javax.management.DynamicMBean; * returns the diagnostic command description * (the same as the one return in the 'help' command) *
  • {@link javax.management.MBeanOperationInfo#getImpact() getImpact()} - * returns ACTION_INFO
  • + * returns {@code ACTION_INFO} *
  • {@link javax.management.MBeanOperationInfo#getReturnType() getReturnType()} * returns {@code java.lang.String}
  • *
  • {@link javax.management.MBeanOperationInfo#getDescriptor() getDescriptor()} @@ -105,7 +105,6 @@ import javax.management.DynamicMBean; * meta-data for a JMX element. A field is a name and an associated value. * The additional meta-data provided for an operation associated with a * diagnostic command are described in the table below: - *

    * *

  • * @@ -161,7 +160,6 @@ import javax.management.DynamicMBean; * arguments supported by the diagnostic command (see below) * *
    - *

    * *

    The description of parameters (options or arguments) of a diagnostic * command is provided within a Descriptor instance. In this Descriptor, diff --git a/jdk/src/java.management/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java b/jdk/src/java.management/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java index 5546f55d05e..68e88b79544 100644 --- a/jdk/src/java.management/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java +++ b/jdk/src/java.management/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java @@ -41,14 +41,14 @@ import sun.management.GarbageCollectionNotifInfoCompositeData; * when the Java virtual machine completes a garbage collection action * The notification emitted will contain the garbage collection notification * information about the status of the memory: - * + *

      *
    • The name of the garbage collector used to perform the collection.
    • *
    • The action performed by the garbage collector.
    • *
    • The cause of the garbage collection action.
    • *
    • A {@link GcInfo} object containing some statistics about the GC cycle (start time, end time) and the memory usage before and after the GC cycle.
    • - * + *
    * *

    * A {@link CompositeData CompositeData} representing @@ -81,7 +81,7 @@ import sun.management.GarbageCollectionNotifInfoCompositeData; *

  • A {@linkplain #GARBAGE_COLLECTION_NOTIFICATION garbage collection notification}. *
    Used by every notification emitted by the garbage collector, the details about * the notification are provided in the {@linkplain #getGcAction action} String - *

  • + * * **/ diff --git a/jdk/src/java.management/share/classes/com/sun/management/GcInfo.java b/jdk/src/java.management/share/classes/com/sun/management/GcInfo.java index 7257b6c6f62..5dc732d84f8 100644 --- a/jdk/src/java.management/share/classes/com/sun/management/GcInfo.java +++ b/jdk/src/java.management/share/classes/com/sun/management/GcInfo.java @@ -52,13 +52,13 @@ import sun.management.GcInfoBuilder; * * *

    - * GcInfo is a {@link CompositeData CompositeData} + * {@code GcInfo} is a {@link CompositeData CompositeData} * The GC-specific attributes can be obtained via the CompositeData * interface. This is a historical relic, and other classes should * not copy this pattern. Use {@link CompositeDataView} instead. * *

    MXBean Mapping

    - * GcInfo is mapped to a {@link CompositeData CompositeData} + * {@code GcInfo} is mapped to a {@link CompositeData CompositeData} * with attributes as specified in the {@link #from from} method. * * @author Mandy Chung @@ -152,11 +152,11 @@ public class GcInfo implements CompositeData, CompositeDataView { * Returns the memory usage of all memory pools * at the beginning of this GC. * This method returns - * a Map of the name of a memory pool + * a {@code Map} of the name of a memory pool * to the memory usage of the corresponding * memory pool before GC starts. * - * @return a Map of memory pool names to the memory + * @return a {@code Map} of memory pool names to the memory * usage of a memory pool before GC starts. */ public Map getMemoryUsageBeforeGc() { @@ -167,11 +167,11 @@ public class GcInfo implements CompositeData, CompositeDataView { * Returns the memory usage of all memory pools * at the end of this GC. * This method returns - * a Map of the name of a memory pool + * a {@code Map} of the name of a memory pool * to the memory usage of the corresponding * memory pool when GC finishes. * - * @return a Map of memory pool names to the memory + * @return a {@code Map} of memory pool names to the memory * usage of a memory pool when GC finishes. */ public Map getMemoryUsageAfterGc() { @@ -179,12 +179,11 @@ public class GcInfo implements CompositeData, CompositeDataView { } /** - * Returns a GcInfo object represented by the - * given CompositeData. The given - * CompositeData must contain + * Returns a {@code GcInfo} object represented by the + * given {@code CompositeData}. The given + * {@code CompositeData} must contain * all the following attributes: * - *

    *

    * * @@ -193,33 +192,33 @@ public class GcInfo implements CompositeData, CompositeDataView { * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * *
    indexjava.lang.Long{@code java.lang.Long}
    startTimejava.lang.Long{@code java.lang.Long}
    endTimejava.lang.Long{@code java.lang.Long}
    memoryUsageBeforeGcjavax.management.openmbean.TabularData{@code javax.management.openmbean.TabularData}
    memoryUsageAfterGcjavax.management.openmbean.TabularData{@code javax.management.openmbean.TabularData}
    *
    * - * @throws IllegalArgumentException if cd does not - * represent a GcInfo object with the attributes + * @throws IllegalArgumentException if {@code cd} does not + * represent a {@code GcInfo} object with the attributes * described above. * - * @return a GcInfo object represented by cd - * if cd is not null; null otherwise. + * @return a {@code GcInfo} object represented by {@code cd} + * if {@code cd} is not {@code null}; {@code null} otherwise. */ public static GcInfo from(CompositeData cd) { if (cd == null) { @@ -272,7 +271,7 @@ public class GcInfo implements CompositeData, CompositeDataView { } /** - *

    Return the {@code CompositeData} representation of this + * Return the {@code CompositeData} representation of this * {@code GcInfo}, including any GC-specific attributes. The * returned value will have at least all the attributes described * in the {@link #from(CompositeData) from} method, plus optionally diff --git a/jdk/src/java.management/share/classes/com/sun/management/VMOption.java b/jdk/src/java.management/share/classes/com/sun/management/VMOption.java index 9c66af1ef5b..b1ba961923d 100644 --- a/jdk/src/java.management/share/classes/com/sun/management/VMOption.java +++ b/jdk/src/java.management/share/classes/com/sun/management/VMOption.java @@ -42,10 +42,10 @@ import javax.management.openmbean.CompositeData; * be set dynamically via a management interface after * the VM was started. * - * A VMOption contains the value of a VM option - * and the origin of that value at the time this VMOption + * A {@code VMOption} contains the value of a VM option + * and the origin of that value at the time this {@code VMOption} * object was constructed. The value of the VM option - * may be changed after the VMOption object was constructed, + * may be changed after the {@code VMOption} object was constructed, * * @see * Java Virtual Machine @@ -108,15 +108,15 @@ public class VMOption { } /** - * Constructs a VMOption. + * Constructs a {@code VMOption}. * * @param name Name of a VM option. * @param value Value of a VM option. - * @param writeable true if a VM option can be set dynamically, - * or false otherwise. + * @param writeable {@code true} if a VM option can be set dynamically, + * or {@code false} otherwise. * @param origin where the value of a VM option came from. * - * @throws NullPointerException if the name or value is null + * @throws NullPointerException if the name or value is {@code null} */ public VMOption(String name, String value, boolean writeable, Origin origin) { this.name = name; @@ -126,7 +126,7 @@ public class VMOption { } /** - * Constructs a VMOption object from a + * Constructs a {@code VMOption} object from a * {@link CompositeData CompositeData}. */ private VMOption(CompositeData cd) { @@ -150,10 +150,10 @@ public class VMOption { /** * Returns the value of this VM option at the time when - * this VMOption was created. The value could have been changed. + * this {@code VMOption} was created. The value could have been changed. * * @return the value of the VM option at the time when - * this VMOption was created. + * this {@code VMOption} was created. */ public String getValue() { return value; @@ -174,7 +174,7 @@ public class VMOption { * it can be set by the {@link HotSpotDiagnosticMXBean#setVMOption * HotSpotDiagnosticMXBean.setVMOption} method. * - * @return true if this VM option is writeable; false + * @return {@code true} if this VM option is writeable; {@code false} * otherwise. */ public boolean isWriteable() { @@ -189,10 +189,10 @@ public class VMOption { } /** - * Returns a VMOption object represented by the - * given CompositeData. The given CompositeData + * Returns a {@code VMOption} object represented by the + * given {@code CompositeData}. The given {@code CompositeData} * must contain the following attributes: - *

    + * *

    * * @@ -201,32 +201,32 @@ public class VMOption { * * * - * + * * * * - * + * * * * - * + * * * * - * + * * *
    namejava.lang.String{@code java.lang.String}
    valuejava.lang.String{@code java.lang.String}
    originjava.lang.String{@code java.lang.String}
    writeablejava.lang.Boolean{@code java.lang.Boolean}
    *
    * - * @param cd CompositeData representing a VMOption + * @param cd {@code CompositeData} representing a {@code VMOption} * - * @throws IllegalArgumentException if cd does not - * represent a VMOption with the attributes described + * @throws IllegalArgumentException if {@code cd} does not + * represent a {@code VMOption} with the attributes described * above. * - * @return a VMOption object represented by cd - * if cd is not null; - * null otherwise. + * @return a {@code VMOption} object represented by {@code cd} + * if {@code cd} is not {@code null}; + * {@code null} otherwise. */ public static VMOption from(CompositeData cd) { if (cd == null) { diff --git a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AgentInitializationException.java b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AgentInitializationException.java index b747a73eabe..058b0f0048f 100644 --- a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AgentInitializationException.java +++ b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AgentInitializationException.java @@ -29,15 +29,15 @@ package com.sun.tools.attach; * The exception thrown when an agent fails to initialize in the target * Java virtual machine. * - *

    This exception is thrown by {@link - * com.sun.tools.attach.VirtualMachine#loadAgent VirtualMachine.loadAgent}, + *

    This exception is thrown by + * {@link com.sun.tools.attach.VirtualMachine#loadAgent VirtualMachine.loadAgent}, * {@link com.sun.tools.attach.VirtualMachine#loadAgentLibrary - * VirtualMachine.loadAgentLibrary}, {@link - * com.sun.tools.attach.VirtualMachine#loadAgentPath VirtualMachine.loadAgentPath} + * VirtualMachine.loadAgentLibrary}, + * {@link com.sun.tools.attach.VirtualMachine#loadAgentPath VirtualMachine.loadAgentPath} * methods if an agent, or agent library, cannot be initialized. - * When thrown by VirtualMachine.loadAgentLibrary, or - * VirtualMachine.loadAgentPath then the exception encapsulates - * the error returned by the agent's Agent_OnAttach function. + * When thrown by {@code VirtualMachine.loadAgentLibrary}, or + * {@code VirtualMachine.loadAgentPath} then the exception encapsulates + * the error returned by the agent's {@code Agent_OnAttach} function. * This error code can be obtained by invoking the {@link #returnValue() returnValue} method. */ @jdk.Exported @@ -49,7 +49,7 @@ public class AgentInitializationException extends Exception { private int returnValue; /** - * Constructs an AgentInitializationException with + * Constructs an {@code AgentInitializationException} with * no detail message. */ public AgentInitializationException() { @@ -58,7 +58,7 @@ public class AgentInitializationException extends Exception { } /** - * Constructs an AgentInitializationException with + * Constructs an {@code AgentInitializationException} with * the specified detail message. * * @param s the detail message. @@ -69,9 +69,9 @@ public class AgentInitializationException extends Exception { } /** - * Constructs an AgentInitializationException with + * Constructs an {@code AgentInitializationException} with * the specified detail message and the return value from the - * execution of the agent's Agent_OnAttach function. + * execution of the agent's {@code Agent_OnAttach} function. * * @param s the detail message. * @param returnValue the return value @@ -83,8 +83,8 @@ public class AgentInitializationException extends Exception { /** * If the exception was created with the return value from the agent - * Agent_OnAttach function then this returns that value, - * otherwise returns 0.

    + * {@code Agent_OnAttach} function then this returns that value, + * otherwise returns {@code 0}. * * @return the return value */ diff --git a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/spi/AttachProvider.java b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/spi/AttachProvider.java index aa4a521ffae..4948be78031 100644 --- a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/spi/AttachProvider.java +++ b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/spi/AttachProvider.java @@ -41,7 +41,7 @@ import java.util.ServiceLoader; * *

    An attach provider is a concrete subclass of this class that has a * zero-argument constructor and implements the abstract methods specified - * below.

    + * below. * *

    An attach provider implementation is typically tied to a Java virtual * machine implementation, version, or even mode of operation. That is, a specific @@ -51,7 +51,7 @@ import java.util.ServiceLoader; * Sun's HotSpot virtual machine. In general, if an environment * consists of Java virtual machines of different versions and from different * vendors then there will be an attach provider implementation for each - * family of implementations or versions.

    + * family of implementations or versions. * *

    An attach provider is identified by its {@link #name name} and * {@link #type type}. The name is typically, but not required to @@ -61,15 +61,15 @@ import java.util.ServiceLoader; * implementation that uses the Doors inter-process communication mechanism * might use the type "doors". The purpose of the name and type is to * identify providers in environments where there are multiple providers - * installed.

    + * installed. * *

    AttachProvider implementations are loaded and instantiated at the first * invocation of the {@link #providers() providers} method. This method * attempts to load all provider implementations that are installed on the - * platform.

    + * platform. * *

    All of the methods in this class are safe for use by multiple - * concurrent threads.

    + * concurrent threads. * * @since 1.6 */ @@ -81,12 +81,12 @@ public abstract class AttachProvider { private static List providers = null; /** - * Initializes a new instance of this class.

    + * Initializes a new instance of this class. * * @throws SecurityException * If a security manager has been installed and it denies * {@link com.sun.tools.attach.AttachPermission AttachPermission} - * ("createAttachProvider") + * ("{@code createAttachProvider}") */ protected AttachProvider() { SecurityManager sm = System.getSecurityManager(); @@ -95,14 +95,14 @@ public abstract class AttachProvider { } /** - * Return this provider's name.

    + * Return this provider's name. * * @return The name of this provider */ public abstract String name(); /** - * Return this provider's type.

    + * Return this provider's type. * * @return The type of this provider */ @@ -113,18 +113,18 @@ public abstract class AttachProvider { * *

    A Java virtual machine is identified by an abstract identifier. The * nature of this identifier is platform dependent but in many cases it will be the - * string representation of the process identifier (or pid).

    + * string representation of the process identifier (or pid). * *

    This method parses the identifier and maps the identifier to a Java * virtual machine (in an implementation dependent manner). If the identifier - * cannot be parsed by the provider then an {@link - * com.sun.tools.attach.AttachNotSupportedException AttachNotSupportedException} + * cannot be parsed by the provider then an + * {@link com.sun.tools.attach.AttachNotSupportedException AttachNotSupportedException} * is thrown. Once parsed this method attempts to attach to the Java virtual machine. * If the provider detects that the identifier corresponds to a Java virtual machine * that does not exist, or it corresponds to a Java virtual machine that does not support * the attach mechanism implemented by this provider, or it detects that the * Java virtual machine is a version to which this provider cannot attach, then - * an AttachNotSupportedException is thrown.

    + * an {@code AttachNotSupportedException} is thrown. * * @param id * The abstract identifier that identifies the Java virtual machine. @@ -134,7 +134,7 @@ public abstract class AttachProvider { * @throws SecurityException * If a security manager has been installed and it denies * {@link com.sun.tools.attach.AttachPermission AttachPermission} - * ("attachVirtualMachine"), or other permission + * ("{@code attachVirtualMachine}"), or other permission * required by the implementation. * * @throws AttachNotSupportedException @@ -147,7 +147,7 @@ public abstract class AttachProvider { * If some other I/O error occurs * * @throws NullPointerException - * If id is null + * If {@code id} is {@code null} */ public abstract VirtualMachine attachVirtualMachine(String id) throws AttachNotSupportedException, IOException; @@ -155,10 +155,10 @@ public abstract class AttachProvider { /** * Attaches to a Java virtual machine. * - *

    A Java virtual machine can be described using a {@link - * com.sun.tools.attach.VirtualMachineDescriptor VirtualMachineDescriptor}. - * This method invokes the descriptor's {@link - * com.sun.tools.attach.VirtualMachineDescriptor#provider() provider()} method + *

    A Java virtual machine can be described using a + * {@link com.sun.tools.attach.VirtualMachineDescriptor VirtualMachineDescriptor}. + * This method invokes the descriptor's + * {@link com.sun.tools.attach.VirtualMachineDescriptor#provider() provider()} method * to check that it is equal to this provider. It then attempts to attach to the * Java virtual machine. * @@ -170,20 +170,20 @@ public abstract class AttachProvider { * @throws SecurityException * If a security manager has been installed and it denies * {@link com.sun.tools.attach.AttachPermission AttachPermission} - * ("attachVirtualMachine"), or other permission + * ("{@code attachVirtualMachine}"), or other permission * required by the implementation. * * @throws AttachNotSupportedException - * If the descriptor's {@link - * com.sun.tools.attach.VirtualMachineDescriptor#provider() provider()} method - * returns a provider that is not this provider, or it does not correspond - * to a Java virtual machine to which this provider can attach. + * If the descriptor's + * {@link com.sun.tools.attach.VirtualMachineDescriptor#provider() provider()} + * method returns a provider that is not this provider, or it does not + * correspond to a Java virtual machine to which this provider can attach. * * @throws IOException * If some other I/O error occurs * * @throws NullPointerException - * If vmd is null + * If {@code vmd} is {@code null} */ public VirtualMachine attachVirtualMachine(VirtualMachineDescriptor vmd) throws AttachNotSupportedException, IOException @@ -197,12 +197,13 @@ public abstract class AttachProvider { /** * Lists the Java virtual machines known to this provider. * - *

    This method returns a list of {@link - * com.sun.tools.attach.VirtualMachineDescriptor} elements. Each - * VirtualMachineDescriptor describes a Java virtual machine + *

    This method returns a list of + * {@link com.sun.tools.attach.VirtualMachineDescriptor} elements. Each + * {@code VirtualMachineDescriptor} describes a Java virtual machine * to which this provider can potentially attach. There isn't any - * guarantee that invoking {@link #attachVirtualMachine(VirtualMachineDescriptor) - * attachVirtualMachine} on each descriptor in the list will succeed. + * guarantee that invoking + * {@link #attachVirtualMachine(VirtualMachineDescriptor) attachVirtualMachine} + * on each descriptor in the list will succeed. * * @return The list of virtual machine descriptors which describe the * Java virtual machines known to this provider (may be empty). @@ -216,31 +217,31 @@ public abstract class AttachProvider { *

    An AttachProvider is installed on the platform if: * *

      - *
    • It is installed in a JAR file that is visible to the defining + *

    • It is installed in a JAR file that is visible to the defining * class loader of the AttachProvider type (usually, but not required * to be, the {@link java.lang.ClassLoader#getSystemClassLoader system - * class loader}).

    • + * class loader}). * - *
    • The JAR file contains a provider configuration named - * com.sun.tools.attach.spi.AttachProvider in the resource directory - * META-INF/services.

    • + *
    • The JAR file contains a provider configuration named + * {@code com.sun.tools.attach.spi.AttachProvider} in the resource directory + * {@code META-INF/services}.
    • * - *
    • The provider configuration file lists the full-qualified class - * name of the AttachProvider implementation.

    • + *
    • The provider configuration file lists the full-qualified class + * name of the AttachProvider implementation.
    • *
    * *

    The format of the provider configuration file is one fully-qualified * class name per line. Space and tab characters surrounding each class name, * as well as blank lines are ignored. The comment character is - * '#' (0x23), and on each line all characters following + * {@code '#'} ({@code 0x23}), and on each line all characters following * the first comment character are ignored. The file must be encoded in - * UTF-8.

    + * UTF-8. * *

    AttachProvider implementations are loaded and instantiated * (using the zero-arg constructor) at the first invocation of this method. * The list returned by the first invocation of this method is the list * of providers. Subsequent invocations of this method return a list of the same - * providers. The list is unmodifable.

    + * providers. The list is unmodifable. * * @return A list of the installed attach providers. */ diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Filter.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Filter.java index e28bdc6299a..ac5d6fe718b 100644 --- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Filter.java +++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Filter.java @@ -72,7 +72,7 @@ public abstract class Filter { * exchange handler will not be invoked. * @param exchange the HttpExchange * @throws IOException let exceptions pass up the stack - * @throws NullPointerException if exchange is null + * @throws NullPointerException if exchange is {@code null} */ public void doFilter (HttpExchange exchange) throws IOException { if (!iter.hasNext()) { @@ -86,14 +86,14 @@ public abstract class Filter { /** * Asks this filter to pre/post-process the given exchange. The filter - * can :- + * can: *
    • examine or modify the request headers
    • *
    • filter the request body or the response body, by creating suitable * filter streams and calling * {@link HttpExchange#setStreams(InputStream,OutputStream)}
    • *
    • set attribute Objects in the exchange, which other filters or the * exchange handler can access.
    • - *
    • decide to either :-
        + *
      1. decide to either
          *
        1. invoke the next filter in the chain, by calling * {@link Filter.Chain#doFilter(HttpExchange)}
        2. *
        3. terminate the chain of invocation, by not calling @@ -102,12 +102,13 @@ public abstract class Filter { * filters in the Chain have been called, and the response headers can be * examined or modified.
        4. *
        5. if option 2. above taken, then this Filter must use the HttpExchange - * to send back an appropriate response

    - * @param exchange the HttpExchange to be filtered. + * to send back an appropriate response + * + * @param exchange the {@code HttpExchange} to be filtered. * @param chain the Chain which allows the next filter to be invoked. * @throws IOException may be thrown by any filter module, and if * caught, must be rethrown again. - * @throws NullPointerException if either exchange or chain are null + * @throws NullPointerException if either exchange or chain are {@code null} */ public abstract void doFilter (HttpExchange exchange, Chain chain) throws IOException; diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Headers.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Headers.java index 0ca7d39d420..5c0608b84fa 100644 --- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Headers.java +++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Headers.java @@ -29,18 +29,21 @@ import java.util.*; /** * HTTP request and response headers are represented by this class which implements - * the interface {@link java.util.Map}< - * {@link java.lang.String},{@link java.util.List}<{@link java.lang.String}>>. + * the interface + * {@link java.util.Map}{@literal <}{@link java.lang.String}, {@link java.util.List} + * {@literal <}{@link java.lang.String}{@literal >>}. * The keys are case-insensitive Strings representing the header names and - * the value associated with each key is a {@link List}<{@link String}> with one + * the value associated with each key is + * a {@link List}{@literal <}{@link String}{@literal >} with one * element for each occurrence of the header name in the request or response. *

    - * For example, if a response header instance contains one key "HeaderName" with two values "value1 and value2" + * For example, if a response header instance contains + * one key "HeaderName" with two values "value1 and value2" * then this object is output as two header lines: *

      * HeaderName: value1
      * HeaderName: value2
    - * 
    + *
    *

    * All the normal {@link java.util.Map} methods are provided, but the following * additional convenience methods are most likely to be used: diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java index 73d7a0e5f5c..757f067451b 100644 --- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java +++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java @@ -116,9 +116,9 @@ public abstract class HttpExchange { public abstract HttpContext getHttpContext (); /** - * Ends this exchange by doing the following in sequence:

      - *
    1. close the request InputStream, if not already closed

    2. - *
    3. close the response OutputStream, if not already closed.
    4. + * Ends this exchange by doing the following in sequence:
        + *
      1. close the request InputStream, if not already closed;
      2. + *
      3. close the response OutputStream, if not already closed.
      4. *
      */ public abstract void close () ; @@ -163,9 +163,9 @@ public abstract class HttpExchange { * and the numeric response code as specified in this method. The response body length is also specified * as follows. If the response length parameter is greater than zero, this specifies an exact * number of bytes to send and the application must send that exact amount of data. - * If the response length parameter is zero, then chunked transfer encoding is + * If the response length parameter is {@code zero}, then chunked transfer encoding is * used and an arbitrary amount of data may be sent. The application terminates the - * response body by closing the OutputStream. If response length has the value -1 + * response body by closing the OutputStream. If response length has the value {@code -1} * then no response body is being sent. *

      * If the content-length response header has not already been set then @@ -192,7 +192,7 @@ public abstract class HttpExchange { /** * Returns the response code, if it has already been set - * @return the response code, if available. -1 if not available yet. + * @return the response code, if available. {@code -1} if not available yet. */ public abstract int getResponseCode (); @@ -219,7 +219,7 @@ public abstract class HttpExchange { * available. * @param name the name of the attribute to retrieve * @return the attribute object, or null if it does not exist - * @throws NullPointerException if name is null + * @throws NullPointerException if name is {@code null} */ public abstract Object getAttribute (String name) ; @@ -231,9 +231,9 @@ public abstract class HttpExchange { * Each Filter class will document the attributes which they make * available. * @param name the name to associate with the attribute value - * @param value the object to store as the attribute value. null + * @param value the object to store as the attribute value. {@code null} * value is permitted. - * @throws NullPointerException if name is null + * @throws NullPointerException if name is {@code null} */ public abstract void setAttribute (String name, Object value) ; @@ -248,9 +248,9 @@ public abstract class HttpExchange { * required to be) sub-classes of {@link java.io.FilterInputStream} * and {@link java.io.FilterOutputStream}. * @param i the filtered input stream to set as this object's inputstream, - * or null if no change. + * or {@code null} if no change. * @param o the filtered output stream to set as this object's outputstream, - * or null if no change. + * or {@code null} if no change. */ public abstract void setStreams (InputStream i, OutputStream o); @@ -259,7 +259,7 @@ public abstract class HttpExchange { * If an authenticator is set on the HttpContext that owns this exchange, * then this method will return the {@link HttpPrincipal} that represents * the authenticated user for this HttpExchange. - * @return the HttpPrincipal, or null if no authenticator is set. + * @return the HttpPrincipal, or {@code null} if no authenticator is set. */ public abstract HttpPrincipal getPrincipal (); } diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpServer.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpServer.java index 02e9994ea71..f26dc1d65df 100644 --- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpServer.java +++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpServer.java @@ -58,8 +58,8 @@ import com.sun.net.httpserver.spi.HttpServerProvider; * whose path is the longest matching prefix of the request URI's path. * Paths are matched literally, which means that the strings are compared * case sensitively, and with no conversion to or from any encoded forms. - * For example. Given a HttpServer with the following HttpContexts configured.

      - * + * For example. Given a HttpServer with the following HttpContexts configured. + *
      * * * @@ -67,7 +67,7 @@ import com.sun.net.httpserver.spi.HttpServerProvider; *
      ContextContext path
      ctx1"/"
      ctx2"/apps/"
      *

      * the following table shows some request URIs and which, if any context they would - * match with.

      + * match with. * * * @@ -181,7 +181,7 @@ public abstract class HttpServer { * approximately delay seconds have elapsed (whichever happens * sooner). Then, all open TCP connections are closed, the background * thread created by start() exits, and the method returns. - * Once stopped, a HttpServer cannot be re-used.

      + * Once stopped, a HttpServer cannot be re-used. * * @param delay the maximum time in seconds to wait until exchanges have finished. * @throws IllegalArgumentException if delay is less than zero. diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsConfigurator.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsConfigurator.java index eda0e8b5f3d..22bca16346d 100644 --- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsConfigurator.java +++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsConfigurator.java @@ -42,8 +42,8 @@ import javax.net.ssl.*; * the default configuration. *

      * The following example shows how this may be done: - *

      - *

      + * + *
        * SSLContext sslContext = SSLContext.getInstance (....);
        * HttpsServer server = HttpsServer.create();
        *
      @@ -64,7 +64,7 @@ import javax.net.ssl.*;
        *         params.setSSLParameters(sslparams);
        *     }
        * });
      - * 
      + * * @since 1.6 */ @jdk.Exported @@ -102,7 +102,7 @@ public class HttpsConfigurator { *

      * The default implementation of this method uses the * SSLParameters returned from

      - * getSSLContext().getDefaultSSLParameters() + * {@code getSSLContext().getDefaultSSLParameters()} *

      * configure() may be overridden in order to modify this behavior. * See, the example above. diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/package-info.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/package-info.java index 9fc1b7bd13b..84f13d61226 100644 --- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/package-info.java +++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/package-info.java @@ -58,7 +58,7 @@ server.createContext("/applications/myapp", new MyHandler()); server.setExecutor(null); // creates a default executor server.start(); - +

      The example above creates a simple HttpServer which uses the calling application thread to invoke the handle() method for incoming http requests directed to port 8000, and to the path /applications/myapp/. @@ -92,7 +92,7 @@ SSLContext ssl = SSLContext.getInstance("TLS"); ssl.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - +

      In the example above, a keystore file called "testkeys", created with the keytool utility is used as a certificate store for client and server certificates. @@ -119,8 +119,8 @@ } }); - -

      + + @since 1.6 */ @jdk.Exported From 6929be6fff27225a23fa80035ac8c82abaff4f3e Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Tue, 28 Apr 2015 11:10:45 -0700 Subject: [PATCH 5/7] 8075156: (prefs) get*() and remove() should disallow the use of the null control character '\u0000' as key Extend disallowing null control character key to remove() Reviewed-by: rriggs, alanb --- .../java/util/prefs/AbstractPreferences.java | 54 +++++++++++++++-- .../classes/java/util/prefs/Preferences.java | 30 +++++++++- .../util/prefs/FileSystemPreferences.java | 14 +---- .../java/util/prefs/WindowsPreferences.java | 58 +++++++++---------- .../util/prefs/CodePointZeroPrefsTest.java | 49 +++++++++++----- 5 files changed, 140 insertions(+), 65 deletions(-) diff --git a/jdk/src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java b/jdk/src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java index fd3ba69902a..970aa19816d 100644 --- a/jdk/src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java +++ b/jdk/src/java.prefs/share/classes/java/util/prefs/AbstractPreferences.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -78,10 +78,9 @@ import java.lang.Double; * under which these calls cannot even enqueue the requested operation for * later processing. Even under these circumstances it is generally better to * simply ignore the invocation and return, rather than throwing an - * exception. Under these circumstances, however, all subsequent invocations - * of flush() and sync should return false, as - * returning true would imply that all previous operations had - * successfully been made permanent. + * exception. Under these circumstances, however, subsequently invoking + * flush() or sync would not imply that all previous + * operations had successfully been made permanent. * *

      There is one circumstance under which putSpi, removeSpi and * childSpi should throw an exception: if the caller lacks @@ -122,6 +121,13 @@ import java.lang.Double; * @since 1.4 */ public abstract class AbstractPreferences extends Preferences { + /** + * The code point U+0000, assigned to the null control character, is the + * only character encoded in Unicode and ISO/IEC 10646 that is always + * invalid in any XML 1.0 and 1.1 document. + */ + static final int CODE_POINT_U0000 = '\u0000'; + /** * Our name relative to parent. */ @@ -234,6 +240,8 @@ public abstract class AbstractPreferences extends Preferences { * @throws IllegalArgumentException if key.length() exceeds * MAX_KEY_LENGTH or if value.length exceeds * MAX_VALUE_LENGTH. + * @throws IllegalArgumentException if either key or value contain + * the null control character, code point U+0000. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. */ @@ -244,6 +252,10 @@ public abstract class AbstractPreferences extends Preferences { throw new IllegalArgumentException("Key too long: "+key); if (value.length() > MAX_VALUE_LENGTH) throw new IllegalArgumentException("Value too long: "+value); + if (key.indexOf(CODE_POINT_U0000) != -1) + throw new IllegalArgumentException("Key contains code point U+0000"); + if (value.indexOf(CODE_POINT_U0000) != -1) + throw new IllegalArgumentException("Value contains code point U+0000"); synchronized(lock) { if (removed) @@ -275,10 +287,14 @@ public abstract class AbstractPreferences extends Preferences { * removed with the {@link #removeNode()} method. * @throws NullPointerException if key is null. (A * null default is permitted.) + * @throws IllegalArgumentException if key contains the null control + * character, code point U+0000. */ public String get(String key, String def) { if (key==null) throw new NullPointerException("Null key"); + if (key.indexOf(CODE_POINT_U0000) != -1) + throw new IllegalArgumentException("Key contains code point U+0000"); synchronized(lock) { if (removed) throw new IllegalStateException("Node has been removed."); @@ -306,10 +322,14 @@ public abstract class AbstractPreferences extends Preferences { * @param key key whose mapping is to be removed from the preference node. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. + * @throws IllegalArgumentException if key contains the null control + * character, code point U+0000. * @throws NullPointerException {@inheritDoc}. */ public void remove(String key) { Objects.requireNonNull(key, "Specified key cannot be null"); + if (key.indexOf(CODE_POINT_U0000) != -1) + throw new IllegalArgumentException("Key contains code point U+0000"); synchronized(lock) { if (removed) throw new IllegalStateException("Node has been removed."); @@ -353,6 +373,8 @@ public abstract class AbstractPreferences extends Preferences { * @throws NullPointerException if key is null. * @throws IllegalArgumentException if key.length() exceeds * MAX_KEY_LENGTH. + * @throws IllegalArgumentException if key contains + * the null control character, code point U+0000. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. */ @@ -381,6 +403,8 @@ public abstract class AbstractPreferences extends Preferences { * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. * @throws NullPointerException if key is null. + * @throws IllegalArgumentException if key contains the null control + * character, code point U+0000. */ public int getInt(String key, int def) { int result = def; @@ -408,6 +432,8 @@ public abstract class AbstractPreferences extends Preferences { * @throws NullPointerException if key is null. * @throws IllegalArgumentException if key.length() exceeds * MAX_KEY_LENGTH. + * @throws IllegalArgumentException if key contains + * the null control character, code point U+0000. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. */ @@ -436,6 +462,8 @@ public abstract class AbstractPreferences extends Preferences { * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. * @throws NullPointerException if key is null. + * @throws IllegalArgumentException if key contains the null control + * character, code point U+0000. */ public long getLong(String key, long def) { long result = def; @@ -463,6 +491,8 @@ public abstract class AbstractPreferences extends Preferences { * @throws NullPointerException if key is null. * @throws IllegalArgumentException if key.length() exceeds * MAX_KEY_LENGTH. + * @throws IllegalArgumentException if key contains + * the null control character, code point U+0000. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. */ @@ -494,6 +524,8 @@ public abstract class AbstractPreferences extends Preferences { * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. * @throws NullPointerException if key is null. + * @throws IllegalArgumentException if key contains the null control + * character, code point U+0000. */ public boolean getBoolean(String key, boolean def) { boolean result = def; @@ -521,6 +553,8 @@ public abstract class AbstractPreferences extends Preferences { * @throws NullPointerException if key is null. * @throws IllegalArgumentException if key.length() exceeds * MAX_KEY_LENGTH. + * @throws IllegalArgumentException if key contains + * the null control character, code point U+0000. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. */ @@ -549,6 +583,8 @@ public abstract class AbstractPreferences extends Preferences { * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. * @throws NullPointerException if key is null. + * @throws IllegalArgumentException if key contains the null control + * character, code point U+0000. */ public float getFloat(String key, float def) { float result = def; @@ -576,6 +612,8 @@ public abstract class AbstractPreferences extends Preferences { * @throws NullPointerException if key is null. * @throws IllegalArgumentException if key.length() exceeds * MAX_KEY_LENGTH. + * @throws IllegalArgumentException if key contains + * the null control character, code point U+0000. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. */ @@ -604,6 +642,8 @@ public abstract class AbstractPreferences extends Preferences { * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. * @throws NullPointerException if key is null. + * @throws IllegalArgumentException if key contains the null control + * character, code point U+0000. */ public double getDouble(String key, double def) { double result = def; @@ -627,6 +667,8 @@ public abstract class AbstractPreferences extends Preferences { * @throws NullPointerException if key or value is null. * @throws IllegalArgumentException if key.length() exceeds MAX_KEY_LENGTH * or if value.length exceeds MAX_VALUE_LENGTH*3/4. + * @throws IllegalArgumentException if key contains + * the null control character, code point U+0000. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. */ @@ -650,6 +692,8 @@ public abstract class AbstractPreferences extends Preferences { * removed with the {@link #removeNode()} method. * @throws NullPointerException if key is null. (A * null value for def is permitted.) + * @throws IllegalArgumentException if key contains the null control + * character, code point U+0000. */ public byte[] getByteArray(String key, byte[] def) { byte[] result = def; diff --git a/jdk/src/java.prefs/share/classes/java/util/prefs/Preferences.java b/jdk/src/java.prefs/share/classes/java/util/prefs/Preferences.java index beb0b0fa1a9..9edefc5affb 100644 --- a/jdk/src/java.prefs/share/classes/java/util/prefs/Preferences.java +++ b/jdk/src/java.prefs/share/classes/java/util/prefs/Preferences.java @@ -489,7 +489,7 @@ public abstract class Preferences { * MAX_VALUE_LENGTH. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. - * @throws IllegalArgumentException if either the key or the value contain + * @throws IllegalArgumentException if either key or value contain * the null control character, code point U+0000. */ public abstract void put(String key, String value); @@ -514,6 +514,8 @@ public abstract class Preferences { * removed with the {@link #removeNode()} method. * @throws NullPointerException if key is null. (A * null value for def is permitted.) + * @throws IllegalArgumentException if key contains the null control + * character, code point U+0000. */ public abstract String get(String key, String def); @@ -530,6 +532,8 @@ public abstract class Preferences { * @throws NullPointerException if key is null. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. + * @throws IllegalArgumentException if key contains the null control + * character, code point U+0000. */ public abstract void remove(String key); @@ -566,6 +570,8 @@ public abstract class Preferences { * MAX_KEY_LENGTH. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. + * @throws IllegalArgumentException if key contains + * the null control character, code point U+0000. * @see #getInt(String,int) */ public abstract void putInt(String key, int value); @@ -597,6 +603,8 @@ public abstract class Preferences { * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. * @throws NullPointerException if key is null. + * @throws IllegalArgumentException if key contains the null control + * character, code point U+0000. * @see #putInt(String,int) * @see #get(String,String) */ @@ -616,6 +624,8 @@ public abstract class Preferences { * MAX_KEY_LENGTH. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. + * @throws IllegalArgumentException if key contains + * the null control character, code point U+0000. * @see #getLong(String,long) */ public abstract void putLong(String key, long value); @@ -647,6 +657,8 @@ public abstract class Preferences { * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. * @throws NullPointerException if key is null. + * @throws IllegalArgumentException if key contains the null control + * character, code point U+0000. * @see #putLong(String,long) * @see #get(String,String) */ @@ -666,6 +678,8 @@ public abstract class Preferences { * MAX_KEY_LENGTH. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. + * @throws IllegalArgumentException if key contains + * the null control character, code point U+0000. * @see #getBoolean(String,boolean) * @see #get(String,String) */ @@ -702,6 +716,8 @@ public abstract class Preferences { * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. * @throws NullPointerException if key is null. + * @throws IllegalArgumentException if key contains the null control + * character, code point U+0000. * @see #get(String,String) * @see #putBoolean(String,boolean) */ @@ -721,6 +737,8 @@ public abstract class Preferences { * MAX_KEY_LENGTH. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. + * @throws IllegalArgumentException if key contains + * the null control character, code point U+0000. * @see #getFloat(String,float) */ public abstract void putFloat(String key, float value); @@ -751,6 +769,8 @@ public abstract class Preferences { * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. * @throws NullPointerException if key is null. + * @throws IllegalArgumentException if key contains the null control + * character, code point U+0000. * @see #putFloat(String,float) * @see #get(String,String) */ @@ -770,6 +790,8 @@ public abstract class Preferences { * MAX_KEY_LENGTH. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. + * @throws IllegalArgumentException if key contains + * the null control character, code point U+0000. * @see #getDouble(String,double) */ public abstract void putDouble(String key, double value); @@ -800,6 +822,8 @@ public abstract class Preferences { * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. * @throws NullPointerException if key is null. + * @throws IllegalArgumentException if key contains the null control + * character, code point U+0000. * @see #putDouble(String,double) * @see #get(String,String) */ @@ -825,6 +849,8 @@ public abstract class Preferences { * or if value.length exceeds MAX_VALUE_LENGTH*3/4. * @throws IllegalStateException if this node (or an ancestor) has been * removed with the {@link #removeNode()} method. + * @throws IllegalArgumentException if key contains + * the null control character, code point U+0000. * @see #getByteArray(String,byte[]) * @see #get(String,String) */ @@ -864,6 +890,8 @@ public abstract class Preferences { * removed with the {@link #removeNode()} method. * @throws NullPointerException if key is null. (A * null value for def is permitted.) + * @throws IllegalArgumentException if key contains the null control + * character, code point U+0000. * @see #get(String,String) * @see #putByteArray(String,byte[]) */ diff --git a/jdk/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java b/jdk/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java index 9d412ed7f67..10188cc98c5 100644 --- a/jdk/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java +++ b/jdk/src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,13 +49,6 @@ import sun.util.logging.PlatformLogger; */ class FileSystemPreferences extends AbstractPreferences { - /** - * The code point U+0000, assigned to the null control character, is the - * only character encoded in Unicode and ISO/IEC 10646 that is always - * invalid in any XML 1.0 and 1.1 document. - */ - private static final String CODE_POINT_U0000 = String.valueOf('\u0000'); - static { PrivilegedAction load = () -> { System.loadLibrary("prefs"); @@ -532,11 +525,6 @@ class FileSystemPreferences extends AbstractPreferences { } protected void putSpi(String key, String value) { - if (key.indexOf(CODE_POINT_U0000) != -1) { - throw new IllegalArgumentException("Key contains code point U+0000"); - } else if (value.indexOf(CODE_POINT_U0000) != -1) { - throw new IllegalArgumentException("Value contains code point U+0000"); - } initCacheIfNecessary(); changeLog.add(new Put(key, value)); prefsCache.put(key, value); diff --git a/jdk/src/java.prefs/windows/classes/java/util/prefs/WindowsPreferences.java b/jdk/src/java.prefs/windows/classes/java/util/prefs/WindowsPreferences.java index 6844234d39d..ec5b492ba9d 100644 --- a/jdk/src/java.prefs/windows/classes/java/util/prefs/WindowsPreferences.java +++ b/jdk/src/java.prefs/windows/classes/java/util/prefs/WindowsPreferences.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,8 +25,6 @@ package java.util.prefs; -import java.util.Map; -import java.util.TreeMap; import java.util.StringTokenizer; import java.io.ByteArrayOutputStream; import java.security.AccessController; @@ -46,7 +44,7 @@ import sun.util.logging.PlatformLogger; * @since 1.4 */ -class WindowsPreferences extends AbstractPreferences{ +class WindowsPreferences extends AbstractPreferences { static { PrivilegedAction load = () -> { @@ -620,22 +618,22 @@ class WindowsPreferences extends AbstractPreferences{ * @see #getSpi(String) */ protected void putSpi(String javaName, String value) { - int nativeHandle = openKey(KEY_SET_VALUE); - if (nativeHandle == NULL_NATIVE_HANDLE) { - isBackingStoreAvailable = false; - return; - } - int result = WindowsRegSetValueEx1(nativeHandle, - toWindowsName(javaName), toWindowsValueString(value)); - if (result != ERROR_SUCCESS) { - logger().warning("Could not assign value to key " + - byteArrayToString(toWindowsName(javaName))+ " at Windows registry node " - + byteArrayToString(windowsAbsolutePath()) + " at root 0x" - + Integer.toHexString(rootNativeHandle()) + - ". Windows RegSetValueEx(...) returned error code " + result + "."); - isBackingStoreAvailable = false; + int nativeHandle = openKey(KEY_SET_VALUE); + if (nativeHandle == NULL_NATIVE_HANDLE) { + isBackingStoreAvailable = false; + return; } - closeKey(nativeHandle); + int result = WindowsRegSetValueEx1(nativeHandle, + toWindowsName(javaName), toWindowsValueString(value)); + if (result != ERROR_SUCCESS) { + logger().warning("Could not assign value to key " + + byteArrayToString(toWindowsName(javaName))+ " at Windows registry node " + + byteArrayToString(windowsAbsolutePath()) + " at root 0x" + + Integer.toHexString(rootNativeHandle()) + + ". Windows RegSetValueEx(...) returned error code " + result + "."); + isBackingStoreAvailable = false; + } + closeKey(nativeHandle); } /** @@ -645,18 +643,18 @@ class WindowsPreferences extends AbstractPreferences{ * @see #putSpi(String, String) */ protected String getSpi(String javaName) { - int nativeHandle = openKey(KEY_QUERY_VALUE); - if (nativeHandle == NULL_NATIVE_HANDLE) { - return null; - } - Object resultObject = WindowsRegQueryValueEx(nativeHandle, - toWindowsName(javaName)); - if (resultObject == null) { + int nativeHandle = openKey(KEY_QUERY_VALUE); + if (nativeHandle == NULL_NATIVE_HANDLE) { + return null; + } + Object resultObject = WindowsRegQueryValueEx(nativeHandle, + toWindowsName(javaName)); + if (resultObject == null) { + closeKey(nativeHandle); + return null; + } closeKey(nativeHandle); - return null; - } - closeKey(nativeHandle); - return toJavaValueString((byte[]) resultObject); + return toJavaValueString((byte[]) resultObject); } /** diff --git a/jdk/test/java/util/prefs/CodePointZeroPrefsTest.java b/jdk/test/java/util/prefs/CodePointZeroPrefsTest.java index eb7299b4d98..79fe3f3fb87 100644 --- a/jdk/test/java/util/prefs/CodePointZeroPrefsTest.java +++ b/jdk/test/java/util/prefs/CodePointZeroPrefsTest.java @@ -26,9 +26,8 @@ import java.util.prefs.PreferencesFactory; /* * @test - * @bug 8068373 - * @requires os.family == "linux" | os.family == "solaris" - * @summary Ensure writing a code point U+0000 null control character is detected. + * @bug 8068373 8075110 8075156 + * @summary Ensure a code point U+0000 null control character is detected. */ public class CodePointZeroPrefsTest { @@ -36,52 +35,70 @@ public class CodePointZeroPrefsTest { int failures = 0; - // Deliberately reflect so you can reproduce it on any platform. - Constructor constructor = - Class.forName("java.util.prefs.FileSystemPreferencesFactory").asSubclass(PreferencesFactory.class).getDeclaredConstructor(); - constructor.setAccessible(true); - PreferencesFactory factory = constructor.newInstance(); + Preferences node = Preferences.userRoot().node("com/acme/testing"); - Preferences node = factory.userRoot().node("com/acme/testing"); + // --- put() --- // legal key and value try { node.put("a", "1"); } catch (IllegalArgumentException iae) { - System.err.println("Unexpected IllegalArgumentException for legal key"); + System.err.println("Unexpected IllegalArgumentException for legal put() key"); failures++; } // illegal key only - int numIAEs = 0; try { node.put("a\u0000b", "1"); - System.err.println("IllegalArgumentException not thrown for illegal key"); + System.err.println("IllegalArgumentException not thrown for illegal put() key"); failures++; } catch (IllegalArgumentException iae) { // do nothing } // illegal value only - numIAEs = 0; try { node.put("ab", "2\u00003"); - System.err.println("IllegalArgumentException not thrown for illegal value"); + System.err.println("IllegalArgumentException not thrown for illegal put() value"); failures++; } catch (IllegalArgumentException iae) { // do nothing } // illegal key and value - numIAEs = 0; try { node.put("a\u0000b", "2\u00003"); - System.err.println("IllegalArgumentException not thrown for illegal entry"); + System.err.println("IllegalArgumentException not thrown for illegal put() entry"); failures++; } catch (IllegalArgumentException iae) { // do nothing } + // --- get --- + + // illegal key only + try { + String theDefault = "default"; + String value = node.get("a\u0000b", theDefault); + System.err.println("IllegalArgumentException not thrown for illegal get() key"); + failures++; + } catch (IllegalArgumentException iae) { + // do nothing + } + + // --- remove --- + + // illegal key only + try { + node.remove("a\u0000b"); + System.err.println("IllegalArgumentException not thrown for illegal remove() key"); + failures++; + } catch (IllegalArgumentException iae) { + // do nothing + } + + node.removeNode(); + if (failures != 0) { throw new RuntimeException("CodePointZeroPrefsTest failed with " + failures + " errors!"); From 86a3e55decb42f8c9341c10ddc8b2cea95a716d9 Mon Sep 17 00:00:00 2001 From: Alexander Stepanov Date: Wed, 29 Apr 2015 17:29:14 +0400 Subject: [PATCH 6/7] 8078528: clean out tidy warnings from security.auth Some HTML markup fixes for docs Reviewed-by: xuelei --- .../classes/javax/smartcardio/package.html | 13 +- .../sun/security/auth/NTDomainPrincipal.java | 50 +-- .../security/auth/NTNumericCredential.java | 38 +- .../classes/com/sun/security/auth/NTSid.java | 52 +-- .../security/auth/NTSidDomainPrincipal.java | 38 +- .../security/auth/NTSidGroupPrincipal.java | 38 +- .../auth/NTSidPrimaryGroupPrincipal.java | 38 +- .../sun/security/auth/NTSidUserPrincipal.java | 38 +- .../sun/security/auth/NTUserPrincipal.java | 50 +-- .../com/sun/security/auth/PolicyFile.java | 135 +++---- .../security/auth/PrincipalComparator.java | 30 +- .../auth/SolarisNumericGroupPrincipal.java | 66 ++- .../auth/SolarisNumericUserPrincipal.java | 63 ++- .../sun/security/auth/SolarisPrincipal.java | 46 +-- .../auth/UnixNumericGroupPrincipal.java | 66 ++- .../auth/UnixNumericUserPrincipal.java | 60 ++- .../com/sun/security/auth/UnixPrincipal.java | 46 +-- .../com/sun/security/auth/X500Principal.java | 46 +-- .../security/auth/module/JndiLoginModule.java | 88 ++-- .../auth/module/KeyStoreLoginModule.java | 80 ++-- .../security/auth/module/Krb5LoginModule.java | 377 ++++++++---------- .../security/auth/module/LdapLoginModule.java | 113 +++--- .../security/auth/module/NTLoginModule.java | 62 ++- .../sun/security/auth/module/NTSystem.java | 20 +- .../auth/module/SolarisLoginModule.java | 52 +-- .../security/auth/module/SolarisSystem.java | 12 +- .../security/auth/module/UnixLoginModule.java | 50 +-- .../sun/security/auth/module/UnixSystem.java | 13 +- 28 files changed, 751 insertions(+), 1029 deletions(-) diff --git a/jdk/src/java.smartcardio/share/classes/javax/smartcardio/package.html b/jdk/src/java.smartcardio/share/classes/javax/smartcardio/package.html index e7d5f435001..6686916e6f8 100644 --- a/jdk/src/java.smartcardio/share/classes/javax/smartcardio/package.html +++ b/jdk/src/java.smartcardio/share/classes/javax/smartcardio/package.html @@ -46,27 +46,23 @@ The API is defined by classes in the package CommandAPDU, ResponseAPDU -

      Factory to obtain implementations
      TerminalFactory -

      Main classes for card and terminal functions
      -CardTerminals, -CardTerminal, +CardTerminals, +CardTerminal, Card, CardChannel -

      Supporting permission and exception classes
      -CardPermission, -CardException, +CardPermission, +CardException, CardNotPresentException -

      Service provider interface, not accessed directly by applications
      TerminalFactorySpi @@ -94,7 +90,6 @@ A simple example of using the API is: card.disconnect(false); -

      @since 1.6 @author Andreas Sterbenz @author JSR 268 Expert Group diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTDomainPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTDomainPrincipal.java index e3a46debeed..995732efa16 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTDomainPrincipal.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTDomainPrincipal.java @@ -28,19 +28,19 @@ package com.sun.security.auth; import java.security.Principal; /** - *

      This class implements the Principal interface + * This class implements the {@code Principal} interface * and represents the name of the Windows NT domain into which the * user authenticated. This will be a domain name if the user logged * into a Windows NT domain, a workgroup name if the user logged into * a workgroup, or a machine name if the user logged into a standalone * configuration. * - *

      Principals such as this NTDomainPrincipal - * may be associated with a particular Subject - * to augment that Subject with an additional - * identity. Refer to the Subject class for more information + *

      Principals such as this {@code NTDomainPrincipal} + * may be associated with a particular {@code Subject} + * to augment that {@code Subject} with an additional + * identity. Refer to the {@code Subject} class for more information * on how to achieve this. Authorization decisions can then be based upon - * the Principals associated with a Subject. + * the Principals associated with a {@code Subject}. * * @see java.security.Principal * @see javax.security.auth.Subject @@ -56,14 +56,12 @@ public class NTDomainPrincipal implements Principal, java.io.Serializable { private String name; /** - * Create an NTDomainPrincipal with a Windows NT domain name. + * Create an {@code NTDomainPrincipal} with a Windows NT domain name. * - *

      + * @param name the Windows NT domain name for this user. * - * @param name the Windows NT domain name for this user.

      - * - * @exception NullPointerException if the name - * is null. + * @exception NullPointerException if the {@code name} + * is {@code null}. */ public NTDomainPrincipal(String name) { if (name == null) { @@ -79,23 +77,19 @@ public class NTDomainPrincipal implements Principal, java.io.Serializable { /** * Return the Windows NT domain name for this - * NTDomainPrincipal. - * - *

      + * {@code NTDomainPrincipal}. * * @return the Windows NT domain name for this - * NTDomainPrincipal + * {@code NTDomainPrincipal} */ public String getName() { return name; } /** - * Return a string representation of this NTDomainPrincipal. + * Return a string representation of this {@code NTDomainPrincipal}. * - *

      - * - * @return a string representation of this NTDomainPrincipal. + * @return a string representation of this {@code NTDomainPrincipal}. */ public String toString() { java.text.MessageFormat form = new java.text.MessageFormat @@ -107,18 +101,16 @@ public class NTDomainPrincipal implements Principal, java.io.Serializable { } /** - * Compares the specified Object with this NTDomainPrincipal + * Compares the specified Object with this {@code NTDomainPrincipal} * for equality. Returns true if the given object is also a - * NTDomainPrincipal and the two NTDomainPrincipals + * {@code NTDomainPrincipal} and the two NTDomainPrincipals * have the same name. * - *

      - * * @param o Object to be compared for equality with this - * NTDomainPrincipal. + * {@code NTDomainPrincipal}. * * @return true if the specified Object is equal to this - * NTDomainPrincipal. + * {@code NTDomainPrincipal}. */ public boolean equals(Object o) { if (o == null) @@ -137,11 +129,9 @@ public class NTDomainPrincipal implements Principal, java.io.Serializable { } /** - * Return a hash code for this NTDomainPrincipal. + * Return a hash code for this {@code NTDomainPrincipal}. * - *

      - * - * @return a hash code for this NTDomainPrincipal. + * @return a hash code for this {@code NTDomainPrincipal}. */ public int hashCode() { return this.getName().hashCode(); diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTNumericCredential.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTNumericCredential.java index 59208603c19..eca81587468 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTNumericCredential.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTNumericCredential.java @@ -26,9 +26,8 @@ package com.sun.security.auth; /** - *

      This class abstracts an NT security token + * This class abstracts an NT security token * and provides a mechanism to do same-process security impersonation. - * */ @jdk.Exported @@ -37,12 +36,9 @@ public class NTNumericCredential { private long impersonationToken; /** - * Create an NTNumericCredential with an integer value. - * - *

      - * - * @param token the Windows NT security token for this user.

      + * Create an {@code NTNumericCredential} with an integer value. * + * @param token the Windows NT security token for this user. */ public NTNumericCredential(long token) { this.impersonationToken = token; @@ -50,23 +46,19 @@ public class NTNumericCredential { /** * Return an integer representation of this - * NTNumericCredential. - * - *

      + * {@code NTNumericCredential}. * * @return an integer representation of this - * NTNumericCredential. + * {@code NTNumericCredential}. */ public long getToken() { return impersonationToken; } /** - * Return a string representation of this NTNumericCredential. + * Return a string representation of this {@code NTNumericCredential}. * - *

      - * - * @return a string representation of this NTNumericCredential. + * @return a string representation of this {@code NTNumericCredential}. */ public String toString() { java.text.MessageFormat form = new java.text.MessageFormat @@ -78,18 +70,16 @@ public class NTNumericCredential { } /** - * Compares the specified Object with this NTNumericCredential + * Compares the specified Object with this {@code NTNumericCredential} * for equality. Returns true if the given object is also a - * NTNumericCredential and the two NTNumericCredentials + * {@code NTNumericCredential} and the two NTNumericCredentials * represent the same NT security token. * - *

      - * * @param o Object to be compared for equality with this - * NTNumericCredential. + * {@code NTNumericCredential}. * * @return true if the specified Object is equal to this - * NTNumericCredential. + * {@code NTNumericCredential}. */ public boolean equals(Object o) { if (o == null) @@ -108,11 +98,9 @@ public class NTNumericCredential { } /** - * Return a hash code for this NTNumericCredential. + * Return a hash code for this {@code NTNumericCredential}. * - *

      - * - * @return a hash code for this NTNumericCredential. + * @return a hash code for this {@code NTNumericCredential}. */ public int hashCode() { return (int)this.impersonationToken; diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSid.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSid.java index 28b40b9302f..a304eeb148d 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSid.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSid.java @@ -28,7 +28,7 @@ package com.sun.security.auth; import java.security.Principal; /** - *

      This class implements the Principal interface + * This class implements the {@code Principal} interface * and represents information about a Windows NT user, group or realm. * *

      Windows NT chooses to represent users, groups and realms (or domains) @@ -37,12 +37,12 @@ import java.security.Principal; * also provides services that render these SIDs into string forms. * This class represents these string forms. * - *

      Principals such as this NTSid - * may be associated with a particular Subject - * to augment that Subject with an additional - * identity. Refer to the Subject class for more information + *

      Principals such as this {@code NTSid} + * may be associated with a particular {@code Subject} + * to augment that {@code Subject} with an additional + * identity. Refer to the {@code Subject} class for more information * on how to achieve this. Authorization decisions can then be based upon - * the Principals associated with a Subject. + * the Principals associated with a {@code Subject}. * * @see java.security.Principal * @see javax.security.auth.Subject @@ -58,16 +58,14 @@ public class NTSid implements Principal, java.io.Serializable { private String sid; /** - * Create an NTSid with a Windows NT SID. + * Create an {@code NTSid} with a Windows NT SID. * - *

      + * @param stringSid the Windows NT SID. * - * @param stringSid the Windows NT SID.

      + * @exception NullPointerException if the {@code String} + * is {@code null}. * - * @exception NullPointerException if the String - * is null. - * - * @exception IllegalArgumentException if the String + * @exception IllegalArgumentException if the {@code String} * has zero length. */ public NTSid (String stringSid) { @@ -89,22 +87,18 @@ public class NTSid implements Principal, java.io.Serializable { } /** - * Return a string version of this NTSid. + * Return a string version of this {@code NTSid}. * - *

      - * - * @return a string version of this NTSid + * @return a string version of this {@code NTSid} */ public String getName() { return sid; } /** - * Return a string representation of this NTSid. + * Return a string representation of this {@code NTSid}. * - *

      - * - * @return a string representation of this NTSid. + * @return a string representation of this {@code NTSid}. */ public String toString() { java.text.MessageFormat form = new java.text.MessageFormat @@ -116,18 +110,16 @@ public class NTSid implements Principal, java.io.Serializable { } /** - * Compares the specified Object with this NTSid + * Compares the specified Object with this {@code NTSid} * for equality. Returns true if the given object is also a - * NTSid and the two NTSids have the same String + * {@code NTSid} and the two NTSids have the same String * representation. * - *

      - * * @param o Object to be compared for equality with this - * NTSid. + * {@code NTSid}. * * @return true if the specified Object is equal to this - * NTSid. + * {@code NTSid}. */ public boolean equals(Object o) { if (o == null) @@ -147,11 +139,9 @@ public class NTSid implements Principal, java.io.Serializable { } /** - * Return a hash code for this NTSid. + * Return a hash code for this {@code NTSid}. * - *

      - * - * @return a hash code for this NTSid. + * @return a hash code for this {@code NTSid}. */ public int hashCode() { return sid.hashCode(); diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidDomainPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidDomainPrincipal.java index e065ea49a08..0911f797efe 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidDomainPrincipal.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidDomainPrincipal.java @@ -26,19 +26,19 @@ package com.sun.security.auth; /** - *

      This class extends NTSid + * This class extends {@code NTSid} * and represents a Windows NT user's domain SID. * *

      An NT user only has a domain SID if in fact they are logged * into an NT domain. If the user is logged into a workgroup or * just a standalone configuration, they will NOT have a domain SID. * - *

      Principals such as this NTSidDomainPrincipal - * may be associated with a particular Subject - * to augment that Subject with an additional - * identity. Refer to the Subject class for more information + *

      Principals such as this {@code NTSidDomainPrincipal} + * may be associated with a particular {@code Subject} + * to augment that {@code Subject} with an additional + * identity. Refer to the {@code Subject} class for more information * on how to achieve this. Authorization decisions can then be based upon - * the Principals associated with a Subject. + * the Principals associated with a {@code Subject}. * * @see java.security.Principal * @see javax.security.auth.Subject @@ -49,27 +49,23 @@ public class NTSidDomainPrincipal extends NTSid { private static final long serialVersionUID = 5247810785821650912L; /** - * Create an NTSidDomainPrincipal with a Windows NT SID. - * - *

      + * Create an {@code NTSidDomainPrincipal} with a Windows NT SID. * * @param name a string version of the Windows NT SID for this - * user's domain.

      + * user's domain. * - * @exception NullPointerException if the name - * is null. + * @exception NullPointerException if the {@code name} + * is {@code null}. */ public NTSidDomainPrincipal(String name) { super(name); } /** - * Return a string representation of this NTSidDomainPrincipal. - * - *

      + * Return a string representation of this {@code NTSidDomainPrincipal}. * * @return a string representation of this - * NTSidDomainPrincipal. + * {@code NTSidDomainPrincipal}. */ public String toString() { java.text.MessageFormat form = new java.text.MessageFormat @@ -81,18 +77,16 @@ public class NTSidDomainPrincipal extends NTSid { } /** - * Compares the specified Object with this NTSidDomainPrincipal + * Compares the specified Object with this {@code NTSidDomainPrincipal} * for equality. Returns true if the given object is also a - * NTSidDomainPrincipal and the two NTSidDomainPrincipals + * {@code NTSidDomainPrincipal} and the two NTSidDomainPrincipals * have the same SID. * - *

      - * * @param o Object to be compared for equality with this - * NTSidDomainPrincipal. + * {@code NTSidDomainPrincipal}. * * @return true if the specified Object is equal to this - * NTSidDomainPrincipal. + * {@code NTSidDomainPrincipal}. */ public boolean equals(Object o) { if (o == null) diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidGroupPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidGroupPrincipal.java index 5f509e22ec3..9bdc87b9dc5 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidGroupPrincipal.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidGroupPrincipal.java @@ -26,15 +26,15 @@ package com.sun.security.auth; /** - *

      This class extends NTSid + * This class extends {@code NTSid} * and represents one of the groups to which a Windows NT user belongs. * - *

      Principals such as this NTSidGroupPrincipal - * may be associated with a particular Subject - * to augment that Subject with an additional - * identity. Refer to the Subject class for more information + *

      Principals such as this {@code NTSidGroupPrincipal} + * may be associated with a particular {@code Subject} + * to augment that {@code Subject} with an additional + * identity. Refer to the {@code Subject} class for more information * on how to achieve this. Authorization decisions can then be based upon - * the Principals associated with a Subject. + * the Principals associated with a {@code Subject}. * * @see java.security.Principal * @see javax.security.auth.Subject @@ -46,25 +46,21 @@ public class NTSidGroupPrincipal extends NTSid { private static final long serialVersionUID = -1373347438636198229L; /** - * Create an NTSidGroupPrincipal with a Windows NT group name. + * Create an {@code NTSidGroupPrincipal} with a Windows NT group name. * - *

      + * @param name the Windows NT group SID for this user. * - * @param name the Windows NT group SID for this user.

      - * - * @exception NullPointerException if the name - * is null. + * @exception NullPointerException if the {@code name} + * is {@code null}. */ public NTSidGroupPrincipal(String name) { super(name); } /** - * Return a string representation of this NTSidGroupPrincipal. + * Return a string representation of this {@code NTSidGroupPrincipal}. * - *

      - * - * @return a string representation of this NTSidGroupPrincipal. + * @return a string representation of this {@code NTSidGroupPrincipal}. */ public String toString() { java.text.MessageFormat form = new java.text.MessageFormat @@ -76,18 +72,16 @@ public class NTSidGroupPrincipal extends NTSid { } /** - * Compares the specified Object with this NTSidGroupPrincipal + * Compares the specified Object with this {@code NTSidGroupPrincipal} * for equality. Returns true if the given object is also a - * NTSidGroupPrincipal and the two NTSidGroupPrincipals + * {@code NTSidGroupPrincipal} and the two NTSidGroupPrincipals * have the same SID. * - *

      - * * @param o Object to be compared for equality with this - * NTSidGroupPrincipal. + * {@code NTSidGroupPrincipal}. * * @return true if the specified Object is equal to this - * NTSidGroupPrincipal. + * {@code NTSidGroupPrincipal}. */ public boolean equals(Object o) { if (o == null) diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidPrimaryGroupPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidPrimaryGroupPrincipal.java index 4578f271df6..1d33ee3909a 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidPrimaryGroupPrincipal.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidPrimaryGroupPrincipal.java @@ -26,15 +26,15 @@ package com.sun.security.auth; /** - *

      This class extends NTSid + * This class extends {@code NTSid} * and represents a Windows NT user's primary group SID. * - *

      Principals such as this NTSidPrimaryGroupPrincipal - * may be associated with a particular Subject - * to augment that Subject with an additional - * identity. Refer to the Subject class for more information + *

      Principals such as this {@code NTSidPrimaryGroupPrincipal} + * may be associated with a particular {@code Subject} + * to augment that {@code Subject} with an additional + * identity. Refer to the {@code Subject} class for more information * on how to achieve this. Authorization decisions can then be based upon - * the Principals associated with a Subject. + * the Principals associated with a {@code Subject}. * * @see java.security.Principal * @see javax.security.auth.Subject @@ -45,15 +45,13 @@ public class NTSidPrimaryGroupPrincipal extends NTSid { private static final long serialVersionUID = 8011978367305190527L; /** - * Create an NTSidPrimaryGroupPrincipal with a Windows NT + * Create an {@code NTSidPrimaryGroupPrincipal} with a Windows NT * group SID. * - *

      + * @param name the primary Windows NT group SID for this user. * - * @param name the primary Windows NT group SID for this user.

      - * - * @exception NullPointerException if the name - * is null. + * @exception NullPointerException if the {@code name} + * is {@code null}. */ public NTSidPrimaryGroupPrincipal(String name) { super(name); @@ -61,12 +59,10 @@ public class NTSidPrimaryGroupPrincipal extends NTSid { /** * Return a string representation of this - * NTSidPrimaryGroupPrincipal. - * - *

      + * {@code NTSidPrimaryGroupPrincipal}. * * @return a string representation of this - * NTSidPrimaryGroupPrincipal. + * {@code NTSidPrimaryGroupPrincipal}. */ public String toString() { java.text.MessageFormat form = new java.text.MessageFormat @@ -79,18 +75,16 @@ public class NTSidPrimaryGroupPrincipal extends NTSid { /** * Compares the specified Object with this - * NTSidPrimaryGroupPrincipal + * {@code NTSidPrimaryGroupPrincipal} * for equality. Returns true if the given object is also a - * NTSidPrimaryGroupPrincipal and the two + * {@code NTSidPrimaryGroupPrincipal} and the two * NTSidPrimaryGroupPrincipals have the same SID. * - *

      - * * @param o Object to be compared for equality with this - * NTSidPrimaryGroupPrincipal. + * {@code NTSidPrimaryGroupPrincipal}. * * @return true if the specified Object is equal to this - * NTSidPrimaryGroupPrincipal. + * {@code NTSidPrimaryGroupPrincipal}. */ public boolean equals(Object o) { if (o == null) diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidUserPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidUserPrincipal.java index 98b318d4f4a..c95d82a4d0a 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidUserPrincipal.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidUserPrincipal.java @@ -26,15 +26,15 @@ package com.sun.security.auth; /** - *

      This class extends NTSid + * This class extends {@code NTSid} * and represents a Windows NT user's SID. * - *

      Principals such as this NTSidUserPrincipal - * may be associated with a particular Subject - * to augment that Subject with an additional - * identity. Refer to the Subject class for more information + *

      Principals such as this {@code NTSidUserPrincipal} + * may be associated with a particular {@code Subject} + * to augment that {@code Subject} with an additional + * identity. Refer to the {@code Subject} class for more information * on how to achieve this. Authorization decisions can then be based upon - * the Principals associated with a Subject. + * the Principals associated with a {@code Subject}. * * @see java.security.Principal * @see javax.security.auth.Subject @@ -45,25 +45,21 @@ public class NTSidUserPrincipal extends NTSid { private static final long serialVersionUID = -5573239889517749525L; /** - * Create an NTSidUserPrincipal with a Windows NT SID. + * Create an {@code NTSidUserPrincipal} with a Windows NT SID. * - *

      + * @param name a string version of the Windows NT SID for this user. * - * @param name a string version of the Windows NT SID for this user.

      - * - * @exception NullPointerException if the name - * is null. + * @exception NullPointerException if the {@code name} + * is {@code null}. */ public NTSidUserPrincipal(String name) { super(name); } /** - * Return a string representation of this NTSidUserPrincipal. + * Return a string representation of this {@code NTSidUserPrincipal}. * - *

      - * - * @return a string representation of this NTSidUserPrincipal. + * @return a string representation of this {@code NTSidUserPrincipal}. */ public String toString() { java.text.MessageFormat form = new java.text.MessageFormat @@ -75,18 +71,16 @@ public class NTSidUserPrincipal extends NTSid { } /** - * Compares the specified Object with this NTSidUserPrincipal + * Compares the specified Object with this {@code NTSidUserPrincipal} * for equality. Returns true if the given object is also a - * NTSidUserPrincipal and the two NTSidUserPrincipals + * {@code NTSidUserPrincipal} and the two NTSidUserPrincipals * have the same SID. * - *

      - * * @param o Object to be compared for equality with this - * NTSidUserPrincipal. + * {@code NTSidUserPrincipal}. * * @return true if the specified Object is equal to this - * NTSidUserPrincipal. + * {@code NTSidUserPrincipal}. */ public boolean equals(Object o) { if (o == null) diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTUserPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTUserPrincipal.java index 55e88e17625..1005793f737 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTUserPrincipal.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTUserPrincipal.java @@ -28,15 +28,15 @@ package com.sun.security.auth; import java.security.Principal; /** - *

      This class implements the Principal interface + * This class implements the {@code Principal} interface * and represents a Windows NT user. * - *

      Principals such as this NTUserPrincipal - * may be associated with a particular Subject - * to augment that Subject with an additional - * identity. Refer to the Subject class for more information + *

      Principals such as this {@code NTUserPrincipal} + * may be associated with a particular {@code Subject} + * to augment that {@code Subject} with an additional + * identity. Refer to the {@code Subject} class for more information * on how to achieve this. Authorization decisions can then be based upon - * the Principals associated with a Subject. + * the Principals associated with a {@code Subject}. * * @see java.security.Principal * @see javax.security.auth.Subject @@ -52,14 +52,12 @@ public class NTUserPrincipal implements Principal, java.io.Serializable { private String name; /** - * Create an NTUserPrincipal with a Windows NT username. + * Create an {@code NTUserPrincipal} with a Windows NT username. * - *

      + * @param name the Windows NT username for this user. * - * @param name the Windows NT username for this user.

      - * - * @exception NullPointerException if the name - * is null. + * @exception NullPointerException if the {@code name} + * is {@code null}. */ public NTUserPrincipal(String name) { if (name == null) { @@ -74,22 +72,18 @@ public class NTUserPrincipal implements Principal, java.io.Serializable { } /** - * Return the Windows NT username for this NTPrincipal. + * Return the Windows NT username for this {@code NTPrincipal}. * - *

      - * - * @return the Windows NT username for this NTPrincipal + * @return the Windows NT username for this {@code NTPrincipal} */ public String getName() { return name; } /** - * Return a string representation of this NTPrincipal. + * Return a string representation of this {@code NTPrincipal}. * - *

      - * - * @return a string representation of this NTPrincipal. + * @return a string representation of this {@code NTPrincipal}. */ public String toString() { java.text.MessageFormat form = new java.text.MessageFormat @@ -101,18 +95,16 @@ public class NTUserPrincipal implements Principal, java.io.Serializable { } /** - * Compares the specified Object with this NTUserPrincipal + * Compares the specified Object with this {@code NTUserPrincipal} * for equality. Returns true if the given object is also a - * NTUserPrincipal and the two NTUserPrincipals + * {@code NTUserPrincipal} and the two NTUserPrincipals * have the same name. * - *

      - * * @param o Object to be compared for equality with this - * NTPrincipal. + * {@code NTPrincipal}. * * @return true if the specified Object is equal to this - * NTPrincipal. + * {@code NTPrincipal}. */ public boolean equals(Object o) { if (o == null) @@ -131,11 +123,9 @@ public class NTUserPrincipal implements Principal, java.io.Serializable { } /** - * Return a hash code for this NTUserPrincipal. + * Return a hash code for this {@code NTUserPrincipal}. * - *

      - * - * @return a hash code for this NTUserPrincipal. + * @return a hash code for this {@code NTUserPrincipal}. */ public int hashCode() { return this.getName().hashCode(); diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/PolicyFile.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/PolicyFile.java index a6402eb68ee..e61e821eca0 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/PolicyFile.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/PolicyFile.java @@ -31,25 +31,25 @@ import javax.security.auth.Subject; /** * This class represents a default implementation for - * javax.security.auth.Policy. + * {@code javax.security.auth.Policy}. * *

      This object stores the policy for entire Java runtime, * and is the amalgamation of multiple static policy * configurations that resides in files. * The algorithm for locating the policy file(s) and reading their - * information into this Policy object is: + * information into this {@code Policy} object is: * *

        *
      1. * Loop through the security properties, * auth.policy.url.1, auth.policy.url.2, ..., * auth.policy.url.X". - * Each property value specifies a URL pointing to a + * Each property value specifies a {@code URL} pointing to a * policy file to be loaded. Read in and load each policy. * *
      2. - * The java.lang.System property java.security.auth.policy - * may also be set to a URL pointing to another policy file + * The {@code java.lang.System} property java.security.auth.policy + * may also be set to a {@code URL} pointing to another policy file * (which is the case when a user uses the -D switch at runtime). * If this property is defined, and its use is allowed by the * security property file (the Security property, @@ -83,35 +83,35 @@ import javax.security.auth.Subject; * doesn't matter and some are optional, as noted below). * Italicized items represent variable values. * - *

        A grant entry must begin with the word grant. - * The signedBy and codeBase + *

        A grant entry must begin with the word {@code grant}. + * The {@code signedBy} and {@code codeBase} * name/value pairs are optional. * If they are not present, then any signer (including unsigned code) * will match, and any codeBase will match. Note that the - * principal name/value pair is not optional. - * This Policy implementation only permits + * {@code principal} name/value pair is not optional. + * This {@code Policy} implementation only permits * Principal-based grant entries. Note that the principalClass * may be set to the wildcard value, *, which allows it to match - * any Principal class. In addition, the principalName + * any {@code Principal} class. In addition, the principalName * may also be set to the wildcard value, *, allowing it to match - * any Principal name. When setting the principalName + * any {@code Principal} name. When setting the principalName * to the *, do not surround the * with quotes. * - *

        A permission entry must begin with the word permission. - * The word Type in the template above is - * a specific permission type, such as java.io.FilePermission - * or java.lang.RuntimePermission. + *

        A permission entry must begin with the word {@code permission}. + * The word {@code Type} in the template above is + * a specific permission type, such as {@code java.io.FilePermission} + * or {@code java.lang.RuntimePermission}. * *

        The "action" is required for - * many permission types, such as java.io.FilePermission + * many permission types, such as {@code java.io.FilePermission} * (where it specifies what type of file access that is permitted). * It is not required for categories such as - * java.lang.RuntimePermission + * {@code java.lang.RuntimePermission} * where it is not necessary - you either have the - * permission specified by the "name" + * permission specified by the "{@code name}" * value following the type name or you don't. * - *

        The signedBy name/value pair for a permission entry + *

        The {@code signedBy} name/value pair for a permission entry * is optional. If present, it indicates a signed permission. That is, * the permission class itself must be signed by the given alias in * order for it to be granted. For example, @@ -124,18 +124,18 @@ import javax.security.auth.Subject; * * *

        Then this permission of type Foo is granted if the - * Foo.class permission has been signed by the - * "FooSoft" alias, or if Foo.class is a + * {@code Foo.class} permission has been signed by the + * "FooSoft" alias, or if {@code Foo.class} is a * system class (i.e., is found on the CLASSPATH). * *

        Items that appear in an entry must appear in the specified order - * (permission, Type, "name", and + * ({@code permission}, Type, "name", and * "action"). An entry is terminated with a semicolon. * - *

        Case is unimportant for the identifiers (permission, - * signedBy, codeBase, etc.) but is + *

        Case is unimportant for the identifiers ({@code permission}, + * {@code signedBy}, {@code codeBase}, etc.) but is * significant for the Type - * or for any string that is passed in as a value.

        + * or for any string that is passed in as a value. * *

        An example of two entries in a policy configuration file is *

        @@ -153,15 +153,15 @@ import javax.security.auth.Subject;
          *         permission java.util.PropertyPermission "java.vendor";
          * 
        * - *

        This Policy implementation supports + *

        This {@code Policy} implementation supports * special handling for PrivateCredentialPermissions. * If a grant entry is configured with a - * PrivateCredentialPermission, + * {@code PrivateCredentialPermission}, * and the "Principal Class/Principal Name" for that - * PrivateCredentialPermission is "self", - * then the entry grants the specified Subject permission to + * {@code PrivateCredentialPermission} is "self", + * then the entry grants the specified {@code Subject} permission to * access its own private Credential. For example, - * the following grants the Subject "Duke" + * the following grants the {@code Subject} "Duke" * access to its own a.b.Credential. * *

        @@ -172,7 +172,7 @@ import javax.security.auth.Subject;
          *    };
          * 
        * - * The following grants the Subject "Duke" + * The following grants the {@code Subject} "Duke" * access to all of its own private Credentials: * *
        @@ -184,7 +184,7 @@ import javax.security.auth.Subject;
          * 
        * * The following grants all Subjects authenticated as a - * SolarisPrincipal (regardless of their respective names) + * {@code SolarisPrincipal} (regardless of their respective names) * permission to access their own private Credentials: * *
        @@ -207,7 +207,7 @@ import javax.security.auth.Subject;
          * 
        * @deprecated As of JDK 1.4, replaced by - * sun.security.provider.PolicyFile. + * {@code sun.security.provider.PolicyFile}. * This class is entirely deprecated. * * @see java.security.CodeSource @@ -232,10 +232,8 @@ public class PolicyFile extends javax.security.auth.Policy { /** * Refreshes the policy object by re-reading all the policy files. * - *

        - * * @exception SecurityException if the caller doesn't have permission - * to refresh the Policy. + * to refresh the {@code Policy}. */ @Override public void refresh() { @@ -243,59 +241,56 @@ public class PolicyFile extends javax.security.auth.Policy { } /** - * Examines this Policy and returns the Permissions granted - * to the specified Subject and CodeSource. + * Examines this {@code Policy} and returns the Permissions granted + * to the specified {@code Subject} and {@code CodeSource}. * *

        Permissions for a particular grant entry are returned - * if the CodeSource constructed using the codebase and - * signedby values specified in the entry implies - * the CodeSource provided to this method, and if the - * Subject provided to this method contains all of the + * if the {@code CodeSource} constructed using the codebase and + * signedby values specified in the entry {@code implies} + * the {@code CodeSource} provided to this method, and if the + * {@code Subject} provided to this method contains all of the * Principals specified in the entry. * - *

        The Subject provided to this method contains all + *

        The {@code Subject} provided to this method contains all * of the Principals specified in the entry if, for each - * Principal, "P1", specified in the grant entry + * {@code Principal}, "P1", specified in the grant entry * one of the following two conditions is met: * - *

        *

          - *
        1. the Subject has a - * Principal, "P2", where - * P2.getClass().getName() equals the + *
        2. the {@code Subject} has a + * {@code Principal}, "P2", where + * {@code P2.getClass().getName()} equals the * P1's class name, and where - * P2.getName() equals the P1's name. + * {@code P2.getName()} equals the P1's name. * *
        3. P1 implements - * com.sun.security.auth.PrincipalComparator, - * and P1.implies the provided Subject. + * {@code com.sun.security.auth.PrincipalComparator}, + * and {@code P1.implies} the provided {@code Subject}. *
        * - *

        Note that this Policy implementation has + *

        Note that this {@code Policy} implementation has * special handling for PrivateCredentialPermissions. - * When this method encounters a PrivateCredentialPermission - * which specifies "self" as the Principal class and name, - * it does not add that Permission to the returned - * PermissionCollection. Instead, it builds - * a new PrivateCredentialPermission - * for each Principal associated with the provided - * Subject. Each new PrivateCredentialPermission + * When this method encounters a {@code PrivateCredentialPermission} + * which specifies "self" as the {@code Principal} class and name, + * it does not add that {@code Permission} to the returned + * {@code PermissionCollection}. Instead, it builds + * a new {@code PrivateCredentialPermission} + * for each {@code Principal} associated with the provided + * {@code Subject}. Each new {@code PrivateCredentialPermission} * contains the same Credential class as specified in the * originally granted permission, as well as the Class and name - * for the respective Principal. + * for the respective {@code Principal}. * - *

        - * - * @param subject the Permissions granted to this Subject - * and the additionally provided CodeSource - * are returned.

        - * - * @param codesource the Permissions granted to this CodeSource - * and the additionally provided Subject + * @param subject the Permissions granted to this {@code Subject} + * and the additionally provided {@code CodeSource} * are returned. * - * @return the Permissions granted to the provided Subject - * CodeSource. + * @param codesource the Permissions granted to this {@code CodeSource} + * and the additionally provided {@code Subject} + * are returned. + * + * @return the Permissions granted to the provided {@code Subject} + * {@code CodeSource}. */ @Override public PermissionCollection getPermissions(final Subject subject, diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/PrincipalComparator.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/PrincipalComparator.java index 8d8e12424a5..bb0aab1f2f2 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/PrincipalComparator.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/PrincipalComparator.java @@ -26,25 +26,25 @@ package com.sun.security.auth; /** - * An object that implements the java.security.Principal + * An object that implements the {@code java.security.Principal} * interface typically also implements this interface to provide - * a means for comparing that object to a specified Subject. + * a means for comparing that object to a specified {@code Subject}. * - *

        The comparison is achieved via the implies method. - * The implementation of the implies method determines - * whether this object "implies" the specified Subject. + *

        The comparison is achieved via the {@code implies} method. + * The implementation of the {@code implies} method determines + * whether this object "implies" the specified {@code Subject}. * One example application of this method may be for - * a "group" object to imply a particular Subject - * if that Subject belongs to the group. + * a "group" object to imply a particular {@code Subject} + * if that {@code Subject} belongs to the group. * Another example application of this method would be for - * "role" object to imply a particular Subject - * if that Subject is currently acting in that role. + * "role" object to imply a particular {@code Subject} + * if that {@code Subject} is currently acting in that role. * *

        Although classes that implement this interface typically - * also implement the java.security.Principal interface, + * also implement the {@code java.security.Principal} interface, * it is not required. In other words, classes may implement the - * java.security.Principal interface by itself, - * the PrincipalComparator interface by itself, + * {@code java.security.Principal} interface by itself, + * the {@code PrincipalComparator} interface by itself, * or both at the same time. * * @see java.security.Principal @@ -53,12 +53,10 @@ package com.sun.security.auth; @jdk.Exported public interface PrincipalComparator { /** - * Check if the specified Subject is implied by + * Check if the specified {@code Subject} is implied by * this object. * - *

        - * - * @return true if the specified Subject is implied by + * @return true if the specified {@code Subject} is implied by * this object, or false otherwise. */ boolean implies(javax.security.auth.Subject subject); diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java index 27e77307703..377e6165fcd 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java @@ -28,15 +28,15 @@ package com.sun.security.auth; import java.security.Principal; /** - *

        This class implements the Principal interface + * This class implements the {@code Principal} interface * and represents a user's Solaris group identification number (GID). * - *

        Principals such as this SolarisNumericGroupPrincipal - * may be associated with a particular Subject - * to augment that Subject with an additional - * identity. Refer to the Subject class for more information + *

        Principals such as this {@code SolarisNumericGroupPrincipal} + * may be associated with a particular {@code Subject} + * to augment that {@code Subject} with an additional + * identity. Refer to the {@code Subject} class for more information * on how to achieve this. Authorization decisions can then be based upon - * the Principals associated with a Subject. + * the Principals associated with a {@code Subject}. * @deprecated As of JDK 1.4, replaced by * {@link UnixNumericGroupPrincipal}. @@ -73,20 +73,18 @@ public class SolarisNumericGroupPrincipal implements private boolean primaryGroup; /** - * Create a SolarisNumericGroupPrincipal using a - * String representation of the user's + * Create a {@code SolarisNumericGroupPrincipal} using a + * {@code String} representation of the user's * group identification number (GID). * - *

        - * * @param name the user's group identification number (GID) - * for this user.

        + * for this user. * * @param primaryGroup true if the specified GID represents the * primary group to which this user belongs. * - * @exception NullPointerException if the name - * is null. + * @exception NullPointerException if the {@code name} + * is {@code null}. */ public SolarisNumericGroupPrincipal(String name, boolean primaryGroup) { if (name == null) @@ -97,13 +95,11 @@ public class SolarisNumericGroupPrincipal implements } /** - * Create a SolarisNumericGroupPrincipal using a + * Create a {@code SolarisNumericGroupPrincipal} using a * long representation of the user's group identification number (GID). * - *

        - * * @param name the user's group identification number (GID) for this user - * represented as a long.

        + * represented as a long. * * @param primaryGroup true if the specified GID represents the * primary group to which this user belongs. @@ -116,12 +112,10 @@ public class SolarisNumericGroupPrincipal implements /** * Return the user's group identification number (GID) for this - * SolarisNumericGroupPrincipal. - * - *

        + * {@code SolarisNumericGroupPrincipal}. * * @return the user's group identification number (GID) for this - * SolarisNumericGroupPrincipal + * {@code SolarisNumericGroupPrincipal} */ public String getName() { return name; @@ -129,12 +123,10 @@ public class SolarisNumericGroupPrincipal implements /** * Return the user's group identification number (GID) for this - * SolarisNumericGroupPrincipal as a long. - * - *

        + * {@code SolarisNumericGroupPrincipal} as a long. * * @return the user's group identification number (GID) for this - * SolarisNumericGroupPrincipal as a long. + * {@code SolarisNumericGroupPrincipal} as a long. */ public long longValue() { return Long.parseLong(name); @@ -144,8 +136,6 @@ public class SolarisNumericGroupPrincipal implements * Return whether this group identification number (GID) represents * the primary group to which this user belongs. * - *

        - * * @return true if this group identification number (GID) represents * the primary group to which this user belongs, * or false otherwise. @@ -156,12 +146,10 @@ public class SolarisNumericGroupPrincipal implements /** * Return a string representation of this - * SolarisNumericGroupPrincipal. - * - *

        + * {@code SolarisNumericGroupPrincipal}. * * @return a string representation of this - * SolarisNumericGroupPrincipal. + * {@code SolarisNumericGroupPrincipal}. */ public String toString() { return((primaryGroup ? @@ -173,19 +161,17 @@ public class SolarisNumericGroupPrincipal implements /** * Compares the specified Object with this - * SolarisNumericGroupPrincipal + * {@code SolarisNumericGroupPrincipal} * for equality. Returns true if the given object is also a - * SolarisNumericGroupPrincipal and the two + * {@code SolarisNumericGroupPrincipal} and the two * SolarisNumericGroupPrincipals * have the same group identification number (GID). * - *

        - * * @param o Object to be compared for equality with this - * SolarisNumericGroupPrincipal. + * {@code SolarisNumericGroupPrincipal}. * * @return true if the specified Object is equal to this - * SolarisNumericGroupPrincipal. + * {@code SolarisNumericGroupPrincipal}. */ public boolean equals(Object o) { if (o == null) @@ -205,11 +191,9 @@ public class SolarisNumericGroupPrincipal implements } /** - * Return a hash code for this SolarisNumericGroupPrincipal. + * Return a hash code for this {@code SolarisNumericGroupPrincipal}. * - *

        - * - * @return a hash code for this SolarisNumericGroupPrincipal. + * @return a hash code for this {@code SolarisNumericGroupPrincipal}. */ public int hashCode() { return toString().hashCode(); diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java index 0369a7830f6..5497856f28a 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java @@ -28,15 +28,15 @@ package com.sun.security.auth; import java.security.Principal; /** - *

        This class implements the Principal interface + * This class implements the {@code Principal} interface * and represents a user's Solaris identification number (UID). * - *

        Principals such as this SolarisNumericUserPrincipal - * may be associated with a particular Subject - * to augment that Subject with an additional - * identity. Refer to the Subject class for more information + *

        Principals such as this {@code SolarisNumericUserPrincipal} + * may be associated with a particular {@code Subject} + * to augment that {@code Subject} with an additional + * identity. Refer to the {@code Subject} class for more information * on how to achieve this. Authorization decisions can then be based upon - * the Principals associated with a Subject. + * the Principals associated with a {@code Subject}. * @deprecated As of JDK 1.4, replaced by * {@link UnixNumericUserPrincipal}. * This class is entirely deprecated. @@ -68,16 +68,14 @@ public class SolarisNumericUserPrincipal implements private String name; /** - * Create a SolarisNumericUserPrincipal using a - * String representation of the + * Create a {@code SolarisNumericUserPrincipal} using a + * {@code String} representation of the * user's identification number (UID). * - *

        - * * @param name the user identification number (UID) for this user. * - * @exception NullPointerException if the name - * is null. + * @exception NullPointerException if the {@code name} + * is {@code null}. */ public SolarisNumericUserPrincipal(String name) { if (name == null) @@ -87,11 +85,9 @@ public class SolarisNumericUserPrincipal implements } /** - * Create a SolarisNumericUserPrincipal using a + * Create a {@code SolarisNumericUserPrincipal} using a * long representation of the user's identification number (UID). * - *

        - * * @param name the user identification number (UID) for this user * represented as a long. */ @@ -101,12 +97,10 @@ public class SolarisNumericUserPrincipal implements /** * Return the user identification number (UID) for this - * SolarisNumericUserPrincipal. - * - *

        + * {@code SolarisNumericUserPrincipal}. * * @return the user identification number (UID) for this - * SolarisNumericUserPrincipal + * {@code SolarisNumericUserPrincipal} */ public String getName() { return name; @@ -114,12 +108,10 @@ public class SolarisNumericUserPrincipal implements /** * Return the user identification number (UID) for this - * SolarisNumericUserPrincipal as a long. - * - *

        + * {@code SolarisNumericUserPrincipal} as a long. * * @return the user identification number (UID) for this - * SolarisNumericUserPrincipal as a long. + * {@code SolarisNumericUserPrincipal} as a long. */ public long longValue() { return Long.parseLong(name); @@ -127,12 +119,10 @@ public class SolarisNumericUserPrincipal implements /** * Return a string representation of this - * SolarisNumericUserPrincipal. - * - *

        + * {@code SolarisNumericUserPrincipal}. * * @return a string representation of this - * SolarisNumericUserPrincipal. + * {@code SolarisNumericUserPrincipal}. */ public String toString() { return(rb.getString("SolarisNumericUserPrincipal.") + name); @@ -140,19 +130,17 @@ public class SolarisNumericUserPrincipal implements /** * Compares the specified Object with this - * SolarisNumericUserPrincipal + * {@code SolarisNumericUserPrincipal} * for equality. Returns true if the given object is also a - * SolarisNumericUserPrincipal and the two + * {@code SolarisNumericUserPrincipal} and the two * SolarisNumericUserPrincipals * have the same user identification number (UID). * - *

        - * * @param o Object to be compared for equality with this - * SolarisNumericUserPrincipal. + * {@code SolarisNumericUserPrincipal}. * * @return true if the specified Object is equal to this - * SolarisNumericUserPrincipal. + * {@code SolarisNumericUserPrincipal}. */ public boolean equals(Object o) { if (o == null) @@ -167,15 +155,14 @@ public class SolarisNumericUserPrincipal implements if (this.getName().equals(that.getName())) return true; - return false; + + return false; } /** - * Return a hash code for this SolarisNumericUserPrincipal. + * Return a hash code for this {@code SolarisNumericUserPrincipal}. * - *

        - * - * @return a hash code for this SolarisNumericUserPrincipal. + * @return a hash code for this {@code SolarisNumericUserPrincipal}. */ public int hashCode() { return name.hashCode(); diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisPrincipal.java index 6fd78fa5cb1..4aef765e813 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisPrincipal.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisPrincipal.java @@ -28,15 +28,15 @@ package com.sun.security.auth; import java.security.Principal; /** - *

        This class implements the Principal interface + * This class implements the {@code Principal} interface * and represents a Solaris user. * - *

        Principals such as this SolarisPrincipal - * may be associated with a particular Subject - * to augment that Subject with an additional - * identity. Refer to the Subject class for more information + *

        Principals such as this {@code SolarisPrincipal} + * may be associated with a particular {@code Subject} + * to augment that {@code Subject} with an additional + * identity. Refer to the {@code Subject} class for more information * on how to achieve this. Authorization decisions can then be based upon - * the Principals associated with a Subject. + * the Principals associated with a {@code Subject}. * * @deprecated As of JDK 1.4, replaced by * {@link UnixPrincipal}. @@ -68,12 +68,10 @@ public class SolarisPrincipal implements Principal, java.io.Serializable { /** * Create a SolarisPrincipal with a Solaris username. * - *

        - * * @param name the Unix username for this user. * - * @exception NullPointerException if the name - * is null. + * @exception NullPointerException if the {@code name} + * is {@code null}. */ public SolarisPrincipal(String name) { if (name == null) @@ -83,40 +81,34 @@ public class SolarisPrincipal implements Principal, java.io.Serializable { } /** - * Return the Unix username for this SolarisPrincipal. + * Return the Unix username for this {@code SolarisPrincipal}. * - *

        - * - * @return the Unix username for this SolarisPrincipal + * @return the Unix username for this {@code SolarisPrincipal} */ public String getName() { return name; } /** - * Return a string representation of this SolarisPrincipal. + * Return a string representation of this {@code SolarisPrincipal}. * - *

        - * - * @return a string representation of this SolarisPrincipal. + * @return a string representation of this {@code SolarisPrincipal}. */ public String toString() { return(rb.getString("SolarisPrincipal.") + name); } /** - * Compares the specified Object with this SolarisPrincipal + * Compares the specified Object with this {@code SolarisPrincipal} * for equality. Returns true if the given object is also a - * SolarisPrincipal and the two SolarisPrincipals + * {@code SolarisPrincipal} and the two SolarisPrincipals * have the same username. * - *

        - * * @param o Object to be compared for equality with this - * SolarisPrincipal. + * {@code SolarisPrincipal}. * * @return true if the specified Object is equal to this - * SolarisPrincipal. + * {@code SolarisPrincipal}. */ public boolean equals(Object o) { if (o == null) @@ -135,11 +127,9 @@ public class SolarisPrincipal implements Principal, java.io.Serializable { } /** - * Return a hash code for this SolarisPrincipal. + * Return a hash code for this {@code SolarisPrincipal}. * - *

        - * - * @return a hash code for this SolarisPrincipal. + * @return a hash code for this {@code SolarisPrincipal}. */ public int hashCode() { return name.hashCode(); diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java index 5edb8d2a4ec..4a96480db01 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java @@ -28,15 +28,15 @@ package com.sun.security.auth; import java.security.Principal; /** - *

        This class implements the Principal interface + * This class implements the {@code Principal} interface * and represents a user's Unix group identification number (GID). * - *

        Principals such as this UnixNumericGroupPrincipal - * may be associated with a particular Subject - * to augment that Subject with an additional - * identity. Refer to the Subject class for more information + *

        Principals such as this {@code UnixNumericGroupPrincipal} + * may be associated with a particular {@code Subject} + * to augment that {@code Subject} with an additional + * identity. Refer to the {@code Subject} class for more information * on how to achieve this. Authorization decisions can then be based upon - * the Principals associated with a Subject. + * the Principals associated with a {@code Subject}. * * @see java.security.Principal * @see javax.security.auth.Subject @@ -59,20 +59,18 @@ public class UnixNumericGroupPrincipal implements private boolean primaryGroup; /** - * Create a UnixNumericGroupPrincipal using a - * String representation of the user's + * Create a {@code UnixNumericGroupPrincipal} using a + * {@code String} representation of the user's * group identification number (GID). * - *

        - * * @param name the user's group identification number (GID) - * for this user.

        + * for this user. * * @param primaryGroup true if the specified GID represents the * primary group to which this user belongs. * - * @exception NullPointerException if the name - * is null. + * @exception NullPointerException if the {@code name} + * is {@code null}. */ public UnixNumericGroupPrincipal(String name, boolean primaryGroup) { if (name == null) { @@ -89,13 +87,11 @@ public class UnixNumericGroupPrincipal implements } /** - * Create a UnixNumericGroupPrincipal using a + * Create a {@code UnixNumericGroupPrincipal} using a * long representation of the user's group identification number (GID). * - *

        - * * @param name the user's group identification number (GID) for this user - * represented as a long.

        + * represented as a long. * * @param primaryGroup true if the specified GID represents the * primary group to which this user belongs. @@ -108,12 +104,10 @@ public class UnixNumericGroupPrincipal implements /** * Return the user's group identification number (GID) for this - * UnixNumericGroupPrincipal. - * - *

        + * {@code UnixNumericGroupPrincipal}. * * @return the user's group identification number (GID) for this - * UnixNumericGroupPrincipal + * {@code UnixNumericGroupPrincipal} */ public String getName() { return name; @@ -121,12 +115,10 @@ public class UnixNumericGroupPrincipal implements /** * Return the user's group identification number (GID) for this - * UnixNumericGroupPrincipal as a long. - * - *

        + * {@code UnixNumericGroupPrincipal} as a long. * * @return the user's group identification number (GID) for this - * UnixNumericGroupPrincipal as a long. + * {@code UnixNumericGroupPrincipal} as a long. */ public long longValue() { return Long.parseLong(name); @@ -136,8 +128,6 @@ public class UnixNumericGroupPrincipal implements * Return whether this group identification number (GID) represents * the primary group to which this user belongs. * - *

        - * * @return true if this group identification number (GID) represents * the primary group to which this user belongs, * or false otherwise. @@ -148,12 +138,10 @@ public class UnixNumericGroupPrincipal implements /** * Return a string representation of this - * UnixNumericGroupPrincipal. - * - *

        + * {@code UnixNumericGroupPrincipal}. * * @return a string representation of this - * UnixNumericGroupPrincipal. + * {@code UnixNumericGroupPrincipal}. */ public String toString() { @@ -176,19 +164,17 @@ public class UnixNumericGroupPrincipal implements /** * Compares the specified Object with this - * UnixNumericGroupPrincipal + * {@code UnixNumericGroupPrincipal} * for equality. Returns true if the given object is also a - * UnixNumericGroupPrincipal and the two + * {@code UnixNumericGroupPrincipal} and the two * UnixNumericGroupPrincipals * have the same group identification number (GID). * - *

        - * * @param o Object to be compared for equality with this - * UnixNumericGroupPrincipal. + * {@code UnixNumericGroupPrincipal}. * * @return true if the specified Object is equal to this - * UnixNumericGroupPrincipal. + * {@code UnixNumericGroupPrincipal}. */ public boolean equals(Object o) { if (o == null) @@ -208,11 +194,9 @@ public class UnixNumericGroupPrincipal implements } /** - * Return a hash code for this UnixNumericGroupPrincipal. + * Return a hash code for this {@code UnixNumericGroupPrincipal}. * - *

        - * - * @return a hash code for this UnixNumericGroupPrincipal. + * @return a hash code for this {@code UnixNumericGroupPrincipal}. */ public int hashCode() { return toString().hashCode(); diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java index bb45c642459..cb252a8966e 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java @@ -28,15 +28,15 @@ package com.sun.security.auth; import java.security.Principal; /** - *

        This class implements the Principal interface + * This class implements the {@code Principal} interface * and represents a user's Unix identification number (UID). * - *

        Principals such as this UnixNumericUserPrincipal - * may be associated with a particular Subject - * to augment that Subject with an additional - * identity. Refer to the Subject class for more information + *

        Principals such as this {@code UnixNumericUserPrincipal} + * may be associated with a particular {@code Subject} + * to augment that {@code Subject} with an additional + * identity. Refer to the {@code Subject} class for more information * on how to achieve this. Authorization decisions can then be based upon - * the Principals associated with a Subject. + * the Principals associated with a {@code Subject}. * * @see java.security.Principal * @see javax.security.auth.Subject @@ -53,16 +53,14 @@ public class UnixNumericUserPrincipal implements private String name; /** - * Create a UnixNumericUserPrincipal using a - * String representation of the + * Create a {@code UnixNumericUserPrincipal} using a + * {@code String} representation of the * user's identification number (UID). * - *

        - * * @param name the user identification number (UID) for this user. * - * @exception NullPointerException if the name - * is null. + * @exception NullPointerException if the {@code name} + * is {@code null}. */ public UnixNumericUserPrincipal(String name) { if (name == null) { @@ -78,11 +76,9 @@ public class UnixNumericUserPrincipal implements } /** - * Create a UnixNumericUserPrincipal using a + * Create a {@code UnixNumericUserPrincipal} using a * long representation of the user's identification number (UID). * - *

        - * * @param name the user identification number (UID) for this user * represented as a long. */ @@ -92,12 +88,10 @@ public class UnixNumericUserPrincipal implements /** * Return the user identification number (UID) for this - * UnixNumericUserPrincipal. - * - *

        + * {@code UnixNumericUserPrincipal}. * * @return the user identification number (UID) for this - * UnixNumericUserPrincipal + * {@code UnixNumericUserPrincipal} */ public String getName() { return name; @@ -105,12 +99,10 @@ public class UnixNumericUserPrincipal implements /** * Return the user identification number (UID) for this - * UnixNumericUserPrincipal as a long. - * - *

        + * {@code UnixNumericUserPrincipal} as a long. * * @return the user identification number (UID) for this - * UnixNumericUserPrincipal as a long. + * {@code UnixNumericUserPrincipal} as a long. */ public long longValue() { return Long.parseLong(name); @@ -118,12 +110,10 @@ public class UnixNumericUserPrincipal implements /** * Return a string representation of this - * UnixNumericUserPrincipal. - * - *

        + * {@code UnixNumericUserPrincipal}. * * @return a string representation of this - * UnixNumericUserPrincipal. + * {@code UnixNumericUserPrincipal}. */ public String toString() { java.text.MessageFormat form = new java.text.MessageFormat @@ -136,19 +126,17 @@ public class UnixNumericUserPrincipal implements /** * Compares the specified Object with this - * UnixNumericUserPrincipal + * {@code UnixNumericUserPrincipal} * for equality. Returns true if the given object is also a - * UnixNumericUserPrincipal and the two + * {@code UnixNumericUserPrincipal} and the two * UnixNumericUserPrincipals * have the same user identification number (UID). * - *

        - * * @param o Object to be compared for equality with this - * UnixNumericUserPrincipal. + * {@code UnixNumericUserPrincipal}. * * @return true if the specified Object is equal to this - * UnixNumericUserPrincipal. + * {@code UnixNumericUserPrincipal}. */ public boolean equals(Object o) { if (o == null) @@ -167,11 +155,9 @@ public class UnixNumericUserPrincipal implements } /** - * Return a hash code for this UnixNumericUserPrincipal. + * Return a hash code for this {@code UnixNumericUserPrincipal}. * - *

        - * - * @return a hash code for this UnixNumericUserPrincipal. + * @return a hash code for this {@code UnixNumericUserPrincipal}. */ public int hashCode() { return name.hashCode(); diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixPrincipal.java index 140bd8ffcd8..9694bc7a443 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixPrincipal.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixPrincipal.java @@ -28,15 +28,15 @@ package com.sun.security.auth; import java.security.Principal; /** - *

        This class implements the Principal interface + * This class implements the {@code Principal} interface * and represents a Unix user. * - *

        Principals such as this UnixPrincipal - * may be associated with a particular Subject - * to augment that Subject with an additional - * identity. Refer to the Subject class for more information + *

        Principals such as this {@code UnixPrincipal} + * may be associated with a particular {@code Subject} + * to augment that {@code Subject} with an additional + * identity. Refer to the {@code Subject} class for more information * on how to achieve this. Authorization decisions can then be based upon - * the Principals associated with a Subject. + * the Principals associated with a {@code Subject}. * * @see java.security.Principal * @see javax.security.auth.Subject @@ -54,12 +54,10 @@ public class UnixPrincipal implements Principal, java.io.Serializable { /** * Create a UnixPrincipal with a Unix username. * - *

        - * * @param name the Unix username for this user. * - * @exception NullPointerException if the name - * is null. + * @exception NullPointerException if the {@code name} + * is {@code null}. */ public UnixPrincipal(String name) { if (name == null) { @@ -75,22 +73,18 @@ public class UnixPrincipal implements Principal, java.io.Serializable { } /** - * Return the Unix username for this UnixPrincipal. + * Return the Unix username for this {@code UnixPrincipal}. * - *

        - * - * @return the Unix username for this UnixPrincipal + * @return the Unix username for this {@code UnixPrincipal} */ public String getName() { return name; } /** - * Return a string representation of this UnixPrincipal. + * Return a string representation of this {@code UnixPrincipal}. * - *

        - * - * @return a string representation of this UnixPrincipal. + * @return a string representation of this {@code UnixPrincipal}. */ public String toString() { java.text.MessageFormat form = new java.text.MessageFormat @@ -102,18 +96,16 @@ public class UnixPrincipal implements Principal, java.io.Serializable { } /** - * Compares the specified Object with this UnixPrincipal + * Compares the specified Object with this {@code UnixPrincipal} * for equality. Returns true if the given object is also a - * UnixPrincipal and the two UnixPrincipals + * {@code UnixPrincipal} and the two UnixPrincipals * have the same username. * - *

        - * * @param o Object to be compared for equality with this - * UnixPrincipal. + * {@code UnixPrincipal}. * * @return true if the specified Object is equal to this - * UnixPrincipal. + * {@code UnixPrincipal}. */ public boolean equals(Object o) { if (o == null) @@ -132,11 +124,9 @@ public class UnixPrincipal implements Principal, java.io.Serializable { } /** - * Return a hash code for this UnixPrincipal. + * Return a hash code for this {@code UnixPrincipal}. * - *

        - * - * @return a hash code for this UnixPrincipal. + * @return a hash code for this {@code UnixPrincipal}. */ public int hashCode() { return name.hashCode(); diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/X500Principal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/X500Principal.java index c4b12bdb28b..52fdcf868c9 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/X500Principal.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/X500Principal.java @@ -29,17 +29,17 @@ import java.security.Principal; import sun.security.x509.X500Name; /** - *

        This class represents an X.500 Principal. + * This class represents an X.500 {@code Principal}. * X500Principals have names such as, * "CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US" * (RFC 1779 style). * - *

        Principals such as this X500Principal - * may be associated with a particular Subject - * to augment that Subject with an additional - * identity. Refer to the Subject class for more information + *

        Principals such as this {@code X500Principal} + * may be associated with a particular {@code Subject} + * to augment that {@code Subject} with an additional + * identity. Refer to the {@code Subject} class for more information * on how to achieve this. Authorization decisions can then be based upon - * the Principals associated with a Subject. + * the Principals associated with a {@code Subject}. * * @see java.security.Principal * @see javax.security.auth.Subject @@ -76,14 +76,12 @@ public class X500Principal implements Principal, java.io.Serializable { * such as "CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US" * (RFC 1779 style). * - *

        - * * @param name the X.500 name * - * @exception NullPointerException if the name - * is null.

        + * @exception NullPointerException if the {@code name} + * is {@code null}. * - * @exception IllegalArgumentException if the name + * @exception IllegalArgumentException if the {@code name} * is improperly specified. */ public X500Principal(String name) { @@ -100,38 +98,32 @@ public class X500Principal implements Principal, java.io.Serializable { } /** - * Return the Unix username for this X500Principal. + * Return the Unix username for this {@code X500Principal}. * - *

        - * - * @return the Unix username for this X500Principal + * @return the Unix username for this {@code X500Principal} */ public String getName() { return thisX500Name.getName(); } /** - * Return a string representation of this X500Principal. + * Return a string representation of this {@code X500Principal}. * - *

        - * - * @return a string representation of this X500Principal. + * @return a string representation of this {@code X500Principal}. */ public String toString() { return thisX500Name.toString(); } /** - * Compares the specified Object with this X500Principal + * Compares the specified Object with this {@code X500Principal} * for equality. * - *

        - * * @param o Object to be compared for equality with this - * X500Principal. + * {@code X500Principal}. * * @return true if the specified Object is equal to this - * X500Principal. + * {@code X500Principal}. */ public boolean equals(Object o) { if (o == null) @@ -159,11 +151,9 @@ public class X500Principal implements Principal, java.io.Serializable { } /** - * Return a hash code for this X500Principal. + * Return a hash code for this {@code X500Principal}. * - *

        - * - * @return a hash code for this X500Principal. + * @return a hash code for this {@code X500Principal}. */ public int hashCode() { return thisX500Name.hashCode(); diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/JndiLoginModule.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/JndiLoginModule.java index e287f858804..08e359b9b8e 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/JndiLoginModule.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/JndiLoginModule.java @@ -44,28 +44,28 @@ import com.sun.security.auth.UnixNumericGroupPrincipal; /** - *

        The module prompts for a username and password + * The module prompts for a username and password * and then verifies the password against the password stored in * a directory service configured under JNDI. * - *

        This LoginModule interoperates with + *

        This {@code LoginModule} interoperates with * any conformant JNDI service provider. To direct this - * LoginModule to use a specific JNDI service provider, - * two options must be specified in the login Configuration - * for this LoginModule. + * {@code LoginModule} to use a specific JNDI service provider, + * two options must be specified in the login {@code Configuration} + * for this {@code LoginModule}. *

          *      user.provider.url=name_service_url
          *      group.provider.url=name_service_url
          * 
        * * name_service_url specifies - * the directory service and path where this LoginModule + * the directory service and path where this {@code LoginModule} * can access the relevant user and group information. Because this - * LoginModule only performs one-level searches to - * find the relevant user information, the URL + * {@code LoginModule} only performs one-level searches to + * find the relevant user information, the {@code URL} * must point to a directory one level above where the user and group * information is stored in the directory service. - * For example, to instruct this LoginModule + * For example, to instruct this {@code LoginModule} * to contact a NIS server, the following URLs must be specified: *
          *    user.provider.url="nis://NISServerHostName/NISDomain/user"
        @@ -90,14 +90,14 @@ import com.sun.security.auth.UnixNumericGroupPrincipal;
          *
          * 

        The format in which the user's information must be stored in * the directory service is specified in RFC 2307. Specifically, - * this LoginModule will search for the user's entry in the + * this {@code LoginModule} will search for the user's entry in the * directory service using the user's uid attribute, * where uid=username. If the search succeeds, - * this LoginModule will then + * this {@code LoginModule} will then * obtain the user's encrypted password from the retrieved entry * using the userPassword attribute. - * This LoginModule assumes that the password is stored - * as a byte array, which when converted to a String, + * This {@code LoginModule} assumes that the password is stored + * as a byte array, which when converted to a {@code String}, * has the following format: *

          *      "{crypt}encrypted_password"
        @@ -106,12 +106,12 @@ import com.sun.security.auth.UnixNumericGroupPrincipal;
          * The LDAP directory server must be configured
          * to permit read access to the userPassword attribute.
          * If the user entered a valid username and password,
        - * this LoginModule associates a
        - * UnixPrincipal, UnixNumericUserPrincipal,
        + * this {@code LoginModule} associates a
        + * {@code UnixPrincipal}, {@code UnixNumericUserPrincipal},
          * and the relevant UnixNumericGroupPrincipals with the
        - * Subject.
        + * {@code Subject}.
          *
        - * 

        This LoginModule also recognizes the following Configuration + *

        This LoginModule also recognizes the following {@code Configuration} * options: *

          *    debug          if, true, debug messages are output to System.out.
        @@ -144,7 +144,7 @@ import com.sun.security.auth.UnixNumericGroupPrincipal;
          *                   exist for the username and password in the shared state,
          *                   or if authentication fails.
          *
        - *    clearPass     if, true, this LoginModule clears the
        + *    clearPass     if, true, this {@code LoginModule} clears the
          *                  username and password stored in the module's shared state
          *                  after both phases of authentication (login and commit)
          *                  have completed.
        @@ -208,21 +208,19 @@ public class JndiLoginModule implements LoginModule {
             private static final String PWD = "javax.security.auth.login.password";
         
             /**
        -     * Initialize this LoginModule.
        +     * Initialize this {@code LoginModule}.
              *
        -     * 

        + * @param subject the {@code Subject} to be authenticated. * - * @param subject the Subject to be authenticated.

        - * - * @param callbackHandler a CallbackHandler for communicating + * @param callbackHandler a {@code CallbackHandler} for communicating * with the end user (prompting for usernames and - * passwords, for example).

        + * passwords, for example). * - * @param sharedState shared LoginModule state.

        + * @param sharedState shared {@code LoginModule} state. * * @param options options specified in the login - * Configuration for this particular - * LoginModule. + * {@code Configuration} for this particular + * {@code LoginModule}. */ // Unchecked warning from (Map)sharedState is safe // since javax.security.auth.login.LoginContext passes a raw HashMap. @@ -255,17 +253,15 @@ public class JndiLoginModule implements LoginModule { } /** - *

        Prompt for username and password. + * Prompt for username and password. * Verify the password against the relevant name service. * - *

        - * - * @return true always, since this LoginModule + * @return true always, since this {@code LoginModule} * should not be ignored. * - * @exception FailedLoginException if the authentication fails.

        + * @exception FailedLoginException if the authentication fails. * - * @exception LoginException if this LoginModule + * @exception LoginException if this {@code LoginModule} * is unable to perform the authentication. */ public boolean login() throws LoginException { @@ -367,15 +363,13 @@ public class JndiLoginModule implements LoginModule { * *

        If this LoginModule's own authentication attempt * succeeded (checked by retrieving the private state saved by the - * login method), then this method associates a - * UnixPrincipal - * with the Subject located in the - * LoginModule. If this LoginModule's own + * {@code login} method), then this method associates a + * {@code UnixPrincipal} + * with the {@code Subject} located in the + * {@code LoginModule}. If this LoginModule's own * authentication attempted failed, then this method removes * any state that was originally saved. * - *

        - * * @exception LoginException if the commit fails * * @return true if this LoginModule's own login and commit @@ -418,18 +412,16 @@ public class JndiLoginModule implements LoginModule { } /** - *

        This method is called if the LoginContext's + * This method is called if the LoginContext's * overall authentication failed. * (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules * did not succeed). * *

        If this LoginModule's own authentication attempt * succeeded (checked by retrieving the private state saved by the - * login and commit methods), + * {@code login} and {@code commit} methods), * then this method cleans up any state that was originally saved. * - *

        - * * @exception LoginException if the abort fails. * * @return false if this LoginModule's own login and/or commit attempts @@ -464,13 +456,11 @@ public class JndiLoginModule implements LoginModule { * Logout a user. * *

        This method removes the Principals - * that were added by the commit method. - * - *

        + * that were added by the {@code commit} method. * * @exception LoginException if the logout fails. * - * @return true in all cases since this LoginModule + * @return true in all cases since this {@code LoginModule} * should not be ignored. */ public boolean logout() throws LoginException { @@ -506,8 +496,6 @@ public class JndiLoginModule implements LoginModule { /** * Attempt authentication * - *

        - * * @param getPasswdFromSharedState boolean that tells this method whether * to retrieve the password from the sharedState. */ @@ -674,8 +662,6 @@ public class JndiLoginModule implements LoginModule { * values in the shared state in case subsequent LoginModules * want to use them via use/tryFirstPass. * - *

        - * * @param getPasswdFromSharedState boolean that tells this method whether * to retrieve the password from the sharedState. */ diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java index 248afb53a9b..ece0d3f8afb 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java @@ -55,53 +55,53 @@ import sun.security.util.Password; /** * Provides a JAAS login module that prompts for a key store alias and * populates the subject with the alias's principal and credentials. Stores - * an X500Principal for the subject distinguished name of the + * an {@code X500Principal} for the subject distinguished name of the * first certificate in the alias's credentials in the subject's principals, * the alias's certificate path in the subject's public credentials, and a - * X500PrivateCredential whose certificate is the first + * {@code X500PrivateCredential} whose certificate is the first * certificate in the alias's certificate path and whose private key is the * alias's private key in the subject's private credentials.

        * * Recognizes the following options in the configuration file: *

        * - *
        keyStoreURL
        + *
        {@code keyStoreURL}
        *
        A URL that specifies the location of the key store. Defaults to * a URL pointing to the .keystore file in the directory specified by the - * user.home system property. The input stream from this - * URL is passed to the KeyStore.load method. - * "NONE" may be specified if a null stream must be - * passed to the KeyStore.load method. + * {@code user.home} system property. The input stream from this + * URL is passed to the {@code KeyStore.load} method. + * "NONE" may be specified if a {@code null} stream must be + * passed to the {@code KeyStore.load} method. * "NONE" should be specified if the KeyStore resides * on a hardware token device, for example.
        * - *
        keyStoreType
        + *
        {@code keyStoreType}
        *
        The key store type. If not specified, defaults to the result of - * calling KeyStore.getDefaultType(). + * calling {@code KeyStore.getDefaultType()}. * If the type is "PKCS11", then keyStoreURL must be "NONE" * and privateKeyPasswordURL must not be specified.
        * - *
        keyStoreProvider
        + *
        {@code keyStoreProvider}
        *
        The key store provider. If not specified, uses the standard search * order to find the provider.
        * - *
        keyStoreAlias
        + *
        {@code keyStoreAlias}
        *
        The alias in the key store to login as. Required when no callback * handler is provided. No default value.
        * - *
        keyStorePasswordURL
        + *
        {@code keyStorePasswordURL}
        *
        A URL that specifies the location of the key store password. Required * when no callback handler is provided and - * protected is false. + * {@code protected} is false. * No default value.
        * - *
        privateKeyPasswordURL
        + *
        {@code privateKeyPasswordURL}
        *
        A URL that specifies the location of the specific private key password * needed to access the private key for this alias. * The keystore password * is used if this value is needed and not specified.
        * - *
        protected
        + *
        {@code protected}
        *
        This value should be set to "true" if the KeyStore * has a separate, protected authentication path * (for example, a dedicated PIN-pad attached to a smart card). @@ -174,22 +174,20 @@ public class KeyStoreLoginModule implements LoginModule { /* -- Methods -- */ /** - * Initialize this LoginModule. + * Initialize this {@code LoginModule}. * - *

        + * @param subject the {@code Subject} to be authenticated. * - * @param subject the Subject to be authenticated.

        - * - * @param callbackHandler a CallbackHandler for communicating + * @param callbackHandler a {@code CallbackHandler} for communicating * with the end user (prompting for usernames and * passwords, for example), - * which may be null.

        + * which may be {@code null}. * - * @param sharedState shared LoginModule state.

        + * @param sharedState shared {@code LoginModule} state. * * @param options options specified in the login - * Configuration for this particular - * LoginModule. + * {@code Configuration} for this particular + * {@code LoginModule}. */ // Unchecked warning from (Map)sharedState is safe // since javax.security.auth.login.LoginContext passes a raw HashMap. @@ -258,11 +256,9 @@ public class KeyStoreLoginModule implements LoginModule { *

        Get the Keystore alias and relevant passwords. * Retrieve the alias's principal and credentials from the Keystore. * - *

        + * @exception FailedLoginException if the authentication fails. * - * @exception FailedLoginException if the authentication fails.

        - * - * @return true in all cases (this LoginModule + * @return true in all cases (this {@code LoginModule} * should not be ignored). */ @@ -719,19 +715,17 @@ public class KeyStoreLoginModule implements LoginModule { * *

        If this LoginModule's own authentication attempt * succeeded (checked by retrieving the private state saved by the - * login method), then this method associates a - * X500Principal for the subject distinguished name of the + * {@code login} method), then this method associates a + * {@code X500Principal} for the subject distinguished name of the * first certificate in the alias's credentials in the subject's * principals,the alias's certificate path in the subject's public - * credentials, and aX500PrivateCredential whose certificate + * credentials, and a {@code X500PrivateCredential} whose certificate * is the first certificate in the alias's certificate path and whose * private key is the alias's private key in the subject's private * credentials. If this LoginModule's own * authentication attempted failed, then this method removes * any state that was originally saved. * - *

        - * * @exception LoginException if the commit fails * * @return true if this LoginModule's own login and commit @@ -774,21 +768,19 @@ public class KeyStoreLoginModule implements LoginModule { } /** - *

        This method is called if the LoginContext's + * This method is called if the LoginContext's * overall authentication failed. * (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules * did not succeed). * *

        If this LoginModule's own authentication attempt * succeeded (checked by retrieving the private state saved by the - * login and commit methods), + * {@code login} and {@code commit} methods), * then this method cleans up any state that was originally saved. * *

        If the loaded KeyStore's provider extends - * java.security.AuthProvider, - * then the provider's logout method is invoked. - * - *

        + * {@code java.security.AuthProvider}, + * then the provider's {@code logout} method is invoked. * * @exception LoginException if the abort fails. * @@ -815,17 +807,15 @@ public class KeyStoreLoginModule implements LoginModule { * Logout a user. * *

        This method removes the Principals, public credentials and the - * private credentials that were added by the commit method. + * private credentials that were added by the {@code commit} method. * *

        If the loaded KeyStore's provider extends - * java.security.AuthProvider, - * then the provider's logout method is invoked. - * - *

        + * {@code java.security.AuthProvider}, + * then the provider's {@code logout} method is invoked. * * @exception LoginException if the logout fails. * - * @return true in all cases since this LoginModule + * @return true in all cases since this {@code LoginModule} * should not be ignored. */ diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/Krb5LoginModule.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/Krb5LoginModule.java index 12ee20b126b..5bd179db91a 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/Krb5LoginModule.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/Krb5LoginModule.java @@ -47,147 +47,142 @@ import sun.security.krb5.Credentials; import sun.misc.HexDumpEncoder; /** - *

        This LoginModule authenticates users using + * This {@code LoginModule} authenticates users using * Kerberos protocols. * - *

        The configuration entry for Krb5LoginModule has + *

        The configuration entry for {@code Krb5LoginModule} has * several options that control the authentication process and - * additions to the Subject's private credential - * set. Irrespective of these options, the Subject's + * additions to the {@code Subject}'s private credential + * set. Irrespective of these options, the {@code Subject}'s * principal set and private credentials set are updated only when - * commit is called. - * When commit is called, the KerberosPrincipal - * is added to the Subject's principal set (unless the - * principal is specified as "*"). If isInitiator - * is true, the KerberosTicket is - * added to the Subject's private credentials. + * {@code commit} is called. + * When {@code commit} is called, the {@code KerberosPrincipal} + * is added to the {@code Subject}'s principal set (unless the + * {@code principal} is specified as "*"). If {@code isInitiator} + * is true, the {@code KerberosTicket} is + * added to the {@code Subject}'s private credentials. * - *

        If the configuration entry for KerberosLoginModule - * has the option storeKey set to true, then - * KerberosKey or KeyTab will also be added to the - * subject's private credentials. KerberosKey, the principal's - * key(s) will be derived from user's password, and KeyTab is - * the keytab used when useKeyTab is set to true. The - * KeyTab object is restricted to be used by the specified + *

        If the configuration entry for {@code KerberosLoginModule} + * has the option {@code storeKey} set to true, then + * {@code KerberosKey} or {@code KeyTab} will also be added to the + * subject's private credentials. {@code KerberosKey}, the principal's + * key(s) will be derived from user's password, and {@code KeyTab} is + * the keytab used when {@code useKeyTab} is set to true. The + * {@code KeyTab} object is restricted to be used by the specified * principal unless the principal value is "*". * - *

        This LoginModule recognizes the doNotPrompt + *

        This {@code LoginModule} recognizes the {@code doNotPrompt} * option. If set to true the user will not be prompted for the password. * *

        The user can specify the location of the ticket cache by using - * the option ticketCache in the configuration entry. + * the option {@code ticketCache} in the configuration entry. * *

        The user can specify the keytab location by using - * the option keyTab + * the option {@code keyTab} * in the configuration entry. * *

        The principal name can be specified in the configuration entry - * by using the option principal. The principal name + * by using the option {@code principal}. The principal name * can either be a simple user name, a service name such as - * host/mission.eng.sun.com, or "*". The principal can also - * be set using the system property sun.security.krb5.principal. + * {@code host/mission.eng.sun.com}, or "*". The principal can also + * be set using the system property {@code sun.security.krb5.principal}. * This property is checked during login. If this property is not set, then * the principal name from the configuration is used. In the * case where the principal property is not set and the principal * entry also does not exist, the user is prompted for the name. - * When this property of entry is set, and useTicketCache + * When this property of entry is set, and {@code useTicketCache} * is set to true, only TGT belonging to this principal is used. * *

        The following is a list of configuration options supported - * for Krb5LoginModule: + * for {@code Krb5LoginModule}: *

        - *
        refreshKrb5Config:
        + *
        {@code refreshKrb5Config}:
        *
        Set this to true, if you want the configuration - * to be refreshed before the login method is called.
        - *
        useTicketCache:
        + * to be refreshed before the {@code login} method is called.
        + *
        {@code useTicketCache}:
        *
        Set this to true, if you want the - * TGT to be obtained - * from the ticket cache. Set this option + * TGT to be obtained from the ticket cache. Set this option * to false if you do not want this module to use the ticket cache. * (Default is False). - * This module will - * search for the ticket - * cache in the following locations: - * On Solaris and Linux - * it will look for the ticket cache in /tmp/krb5cc_uid - * where the uid is numeric user - * identifier. If the ticket cache is + * This module will search for the ticket + * cache in the following locations: On Solaris and Linux + * it will look for the ticket cache in /tmp/krb5cc_{@code uid} + * where the uid is numeric user identifier. If the ticket cache is * not available in the above location, or if we are on a * Windows platform, it will look for the cache as * {user.home}{file.separator}krb5cc_{user.name}. * You can override the ticket cache location by using - * ticketCache. + * {@code ticketCache}. * For Windows, if a ticket cannot be retrieved from the file ticket cache, * it will use Local Security Authority (LSA) API to get the TGT. - *
        ticketCache:
        + *
        {@code ticketCache}:
        *
        Set this to the name of the ticket * cache that contains user's TGT. - * If this is set, useTicketCache + * If this is set, {@code useTicketCache} * must also be set to true; Otherwise a configuration error will * be returned.
        - *
        renewTGT:
        + *
        {@code renewTGT}:
        *
        Set this to true, if you want to renew - * the TGT. If this is set, useTicketCache must also be + * the TGT. If this is set, {@code useTicketCache} must also be * set to true; otherwise a configuration error will be returned.
        - *
        doNotPrompt:
        + *
        {@code doNotPrompt}:
        *
        Set this to true if you do not want to be * prompted for the password * if credentials can not be obtained from the cache, the keytab, * or through shared state.(Default is false) * If set to true, credential must be obtained through cache, keytab, * or shared state. Otherwise, authentication will fail.
        - *
        useKeyTab:
        + *
        {@code useKeyTab}:
        *
        Set this to true if you * want the module to get the principal's key from the * the keytab.(default value is False) - * If keytab - * is not set then + * If {@code keytab} is not set then * the module will locate the keytab from the * Kerberos configuration file. * If it is not specified in the Kerberos configuration file * then it will look for the file - * {user.home}{file.separator}krb5.keytab.
        - *
        keyTab:
        + * {@code {user.home}{file.separator}}krb5.keytab.
      + *
      {@code keyTab}:
      *
      Set this to the file name of the * keytab to get principal's secret key.
      - *
      storeKey:
      + *
      {@code storeKey}:
      *
      Set this to true to if you want the keytab or the * principal's key to be stored in the Subject's private credentials. - * For isInitiator being false, if principal + * For {@code isInitiator} being false, if {@code principal} * is "*", the {@link KeyTab} stored can be used by anyone, otherwise, * it's restricted to be used by the specified principal only.
      - *
      principal:
      + *
      {@code principal}:
      *
      The name of the principal that should * be used. The principal can be a simple username such as - * "testuser" or a service name such as - * "host/testhost.eng.sun.com". You can use the - * principal option to set the principal when there are + * "{@code testuser}" or a service name such as + * "{@code host/testhost.eng.sun.com}". You can use the + * {@code principal} option to set the principal when there are * credentials for multiple principals in the - * keyTab or when you want a specific ticket cache only. + * {@code keyTab} or when you want a specific ticket cache only. * The principal can also be set using the system property - * sun.security.krb5.principal. In addition, if this + * {@code sun.security.krb5.principal}. In addition, if this * system property is defined, then it will be used. If this property * is not set, then the principal name from the configuration will be * used. - * The principal name can be set to "*" when isInitiator is false. + * The principal name can be set to "*" when {@code isInitiator} is false. * In this case, the acceptor is not bound to a single principal. It can * act as any principal an initiator requests if keys for that principal - * can be found. When isInitiator is true, the principal name + * can be found. When {@code isInitiator} is true, the principal name * cannot be set to "*". *
      - *
      isInitiator:
      + *
      {@code isInitiator}:
      *
      Set this to true, if initiator. Set this to false, if acceptor only. * (Default is true). * Note: Do not set this value to false for initiators.
      * * - *

      This LoginModule also recognizes the following additional - * Configuration + *

      This {@code LoginModule} also recognizes the following additional + * {@code Configuration} * options that enable you to share username and passwords across different * authentication modules: *

      * - *
      useFirstPass:
      + *
      {@code useFirstPass}:
      *
      if, true, this LoginModule retrieves the * username and password from the module's shared state, * using "javax.security.auth.login.name" and @@ -197,7 +192,7 @@ import sun.misc.HexDumpEncoder; * is made, and the failure is reported back to the * calling application.
      * - *
      tryFirstPass:
      + *
      {@code tryFirstPass}:
      *
      if, true, this LoginModule retrieves the * the username and password from the module's shared * state using "javax.security.auth.login.name" and @@ -210,7 +205,7 @@ import sun.misc.HexDumpEncoder; * is made. If the authentication fails, * the failure is reported back to the calling application
      * - *
      storePass:
      + *
      {@code storePass}:
      *
      if, true, this LoginModule stores the username and * password obtained from the CallbackHandler in the * modules shared state, using @@ -220,7 +215,7 @@ import sun.misc.HexDumpEncoder; * exist for the username and password in the shared * state, or if authentication fails.
      * - *
      clearPass:
      + *
      {@code clearPass}:
      *
      if, true, this LoginModule clears the * username and password stored in the module's shared * state after both phases of authentication @@ -236,148 +231,137 @@ import sun.misc.HexDumpEncoder; *
    5. shared state *
    6. user prompt * + * *

      Note that if any step fails, it will fallback to the next step. * There's only one exception, if the shared state step fails and - * useFirstPass=true, no user prompt is made. + * {@code useFirstPass = true}, no user prompt is made. *

      Examples of some configuration values for Krb5LoginModule in * JAAS config file and the results are: - *

        - *

        doNotPrompt=true; - *

      - *

      This is an illegal combination since none of useTicketCache, - * useKeyTab, useFirstPass and tryFirstPass - * is set and the user can not be prompted for the password. - *

        - *

        ticketCache = <filename>; - *

      - *

      This is an illegal combination since useTicketCache + *

      + *
      {@code
      + * doNotPrompt = true}
      + * This is an illegal combination since none of {@code useTicketCache, + * useKeyTab, useFirstPass} and {@code tryFirstPass} + * is set and the user can not be prompted for the password.
      + * + *
      {@code
      + * ticketCache = }
      + * This is an illegal combination since {@code useTicketCache} * is not set to true and the ticketCache is set. A configuration error - * will occur. - *
        - *

        renewTGT=true; - *

      - *

      This is an illegal combination since useTicketCache is - * not set to true and renewTGT is set. A configuration error will occur. - *

        - *

        storeKey=true - * useTicketCache = true - * doNotPrompt=true;; - *

      - *

      This is an illegal combination since storeKey is set to + * will occur.

      + * + *
      {@code
      + * renewTGT = true}
      + * This is an illegal combination since {@code useTicketCache} is + * not set to true and renewTGT is set. A configuration error will occur.
      + * + *
      {@code
      + * storeKey = true  useTicketCache = true  doNotPrompt = true}
      + * This is an illegal combination since {@code storeKey} is set to * true but the key can not be obtained either by prompting the user or from - * the keytab, or from the shared state. A configuration error will occur. - *
        - *

        keyTab = <filename> doNotPrompt=true ; - *

      - *

      This is an illegal combination since useKeyTab is not set to true and - * the keyTab is set. A configuration error will occur. - *

        - *

        debug=true - *

      - *

      Prompt the user for the principal name and the password. + * the keytab, or from the shared state. A configuration error will occur.

      + * + *
      {@code
      + * keyTab =   doNotPrompt = true}
      + * This is an illegal combination since useKeyTab is not set to true and + * the keyTab is set. A configuration error will occur.
      + * + *
      {@code
      + * debug = true}
      + * Prompt the user for the principal name and the password. * Use the authentication exchange to get TGT from the KDC and - * populate the Subject with the principal and TGT. - * Output debug messages. - *
        - *

        useTicketCache = true doNotPrompt=true; - *

      - *

      Check the default cache for TGT and populate the Subject + * populate the {@code Subject} with the principal and TGT. + * Output debug messages.

      + * + *
      {@code
      + * useTicketCache = true  doNotPrompt = true}
      + * Check the default cache for TGT and populate the {@code Subject} * with the principal and TGT. If the TGT is not available, - * do not prompt the user, instead fail the authentication. - *
        - *

        principal=<name>useTicketCache = true - * doNotPrompt=true; - *

      - *

      Get the TGT from the default cache for the principal and populate the + * do not prompt the user, instead fail the authentication.

      + * + *
      {@code
      + * principal =   useTicketCache = true  doNotPrompt = true}
      + * Get the TGT from the default cache for the principal and populate the * Subject's principal and private creds set. If ticket cache is * not available or does not contain the principal's TGT - * authentication will fail. - *
        - *

        useTicketCache = true - * ticketCache=<file name>useKeyTab = true - * keyTab=<keytab filename> - * principal = <principal name> - * doNotPrompt=true; - *

      - *

      Search the cache for the principal's TGT. If it is not available + * authentication will fail.

      + * + *
      {@code
      + * useTicketCache = true
      + * ticketCache = 
      + * useKeyTab = true
      + * keyTab = 
      + * principal = 
      + * doNotPrompt = true}
      + * Search the cache for the principal's TGT. If it is not available * use the key in the keytab to perform authentication exchange with the * KDC and acquire the TGT. * The Subject will be populated with the principal and the TGT. - * If the key is not available or valid then authentication will fail. - *
        - *

        useTicketCache = true - * ticketCache=<file name> - *

      - *

      The TGT will be obtained from the cache specified. + * If the key is not available or valid then authentication will fail.

      + * + *
      {@code
      + * useTicketCache = true  ticketCache = }
      + * The TGT will be obtained from the cache specified. * The Kerberos principal name used will be the principal name in * the Ticket cache. If the TGT is not available in the * ticket cache the user will be prompted for the principal name * and the password. The TGT will be obtained using the authentication * exchange with the KDC. - * The Subject will be populated with the TGT. - *
        - *

        useKeyTab = true - * keyTab=<keytab filename> - * principal= <principal name> - * storeKey=true; - *

      - *

      The key for the principal will be retrieved from the keytab. + * The Subject will be populated with the TGT.

      + * + *
      {@code
      + * useKeyTab = true  keyTab=  principal =   storeKey = true}
      + * The key for the principal will be retrieved from the keytab. * If the key is not available in the keytab the user will be prompted * for the principal's password. The Subject will be populated * with the principal's key either from the keytab or derived from the - * password entered. - *
        - *

        useKeyTab = true - * keyTab=<keytabname> - * storeKey=true - * doNotPrompt=false; - *

      - *

      The user will be prompted for the service principal name. + * password entered.

      + * + *
      {@code
      + * useKeyTab = true  keyTab =   storeKey = true  doNotPrompt = false}
      + * The user will be prompted for the service principal name. * If the principal's * longterm key is available in the keytab , it will be added to the * Subject's private credentials. An authentication exchange will be * attempted with the principal name and the key from the Keytab. * If successful the TGT will be added to the - * Subject's private credentials set. Otherwise the authentication will - * fail. - *
        - *

        isInitiator = false useKeyTab = true - * keyTab=<keytabname> - * storeKey=true - * principal=*; - *

      - *

      The acceptor will be an unbound acceptor and it can act as any principal - * as long that principal has keys in the keytab. - *

        - *

        - * useTicketCache=true - * ticketCache=<file name>; - * useKeyTab = true - * keyTab=<file name> storeKey=true - * principal= <principal name> - *

      - *

      + * Subject's private credentials set. Otherwise the authentication will fail.

      + * + *
      {@code
      + * isInitiator = false  useKeyTab = true  keyTab =   storeKey = true  principal = *}
      + * The acceptor will be an unbound acceptor and it can act as any principal + * as long that principal has keys in the keytab.
      + * + *
      {@code
      + * useTicketCache = true
      + * ticketCache = 
      + * useKeyTab = true
      + * keyTab = 
      + * storeKey = true
      + * principal = }
      * The client's TGT will be retrieved from the ticket cache and added to the - * Subject's private credentials. If the TGT is not available + * {@code Subject}'s private credentials. If the TGT is not available * in the ticket cache, or the TGT's client name does not match the principal * name, Java will use a secret key to obtain the TGT using the authentication * exchange and added to the Subject's private credentials. * This secret key will be first retrieved from the keytab. If the key * is not available, the user will be prompted for the password. In either * case, the key derived from the password will be added to the - * Subject's private credentials set. - *
        - *

        isInitiator = false - *

      - *

      Configured to act as acceptor only, credentials are not acquired + * Subject's private credentials set.

      + * + *
      {@code
      + * isInitiator = false}
      + * Configured to act as acceptor only, credentials are not acquired * via AS exchange. For acceptors only, set this value to false. - * For initiators, do not set this value to false. - *
        - *

        isInitiator = true - *

      - *

      Configured to act as initiator, credentials are acquired + * For initiators, do not set this value to false.

      + * + *
      {@code
      + * isInitiator = true}
      + * Configured to act as initiator, credentials are acquired * via AS exchange. For initiators, set this value to true, or leave this - * option unset, in which case default value (true) will be used. + * option unset, in which case default value (true) will be used.
      + * + *
      * * @author Ram Marti */ @@ -445,20 +429,19 @@ public class Krb5LoginModule implements LoginModule { ); /** - * Initialize this LoginModule. + * Initialize this {@code LoginModule}. * - *

      - * @param subject the Subject to be authenticated.

      + * @param subject the {@code Subject} to be authenticated. * - * @param callbackHandler a CallbackHandler for + * @param callbackHandler a {@code CallbackHandler} for * communication with the end user (prompting for - * usernames and passwords, for example).

      + * usernames and passwords, for example). * - * @param sharedState shared LoginModule state.

      + * @param sharedState shared {@code LoginModule} state. * * @param options options specified in the login - * Configuration for this particular - * LoginModule. + * {@code Configuration} for this particular + * {@code LoginModule}. */ // Unchecked warning from (Map)sharedState is safe // since javax.security.auth.login.LoginContext passes a raw HashMap. @@ -536,14 +519,12 @@ public class Krb5LoginModule implements LoginModule { /** * Authenticate the user * - *

      - * - * @return true in all cases since this LoginModule + * @return true in all cases since this {@code LoginModule} * should not be ignored. * - * @exception FailedLoginException if the authentication fails.

      + * @exception FailedLoginException if the authentication fails. * - * @exception LoginException if this LoginModule + * @exception LoginException if this {@code LoginModule} * is unable to perform the authentication. */ public boolean login() throws LoginException { @@ -1019,23 +1000,21 @@ public class Krb5LoginModule implements LoginModule { } /** - *

      This method is called if the LoginContext's + * This method is called if the LoginContext's * overall authentication succeeded * (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL * LoginModules succeeded). * *

      If this LoginModule's own authentication attempt * succeeded (checked by retrieving the private state saved by the - * login method), then this method associates a - * Krb5Principal - * with the Subject located in the - * LoginModule. It adds Kerberos Credentials to the + * {@code login} method), then this method associates a + * {@code Krb5Principal} + * with the {@code Subject} located in the + * {@code LoginModule}. It adds Kerberos Credentials to the * the Subject's private credentials set. If this LoginModule's own * authentication attempted failed, then this method removes * any state that was originally saved. * - *

      - * * @exception LoginException if the commit fails. * * @return true if this LoginModule's own login and commit @@ -1147,18 +1126,16 @@ public class Krb5LoginModule implements LoginModule { } /** - *

      This method is called if the LoginContext's + * This method is called if the LoginContext's * overall authentication failed. * (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL * LoginModules did not succeed). * *

      If this LoginModule's own authentication attempt * succeeded (checked by retrieving the private state saved by the - * login and commit methods), + * {@code login} and {@code commit} methods), * then this method cleans up any state that was originally saved. * - *

      - * * @exception LoginException if the abort fails. * * @return false if this LoginModule's own login and/or commit attempts @@ -1183,14 +1160,12 @@ public class Krb5LoginModule implements LoginModule { /** * Logout the user. * - *

      This method removes the Krb5Principal - * that was added by the commit method. - * - *

      + *

      This method removes the {@code Krb5Principal} + * that was added by the {@code commit} method. * * @exception LoginException if the logout fails. * - * @return true in all cases since this LoginModule + * @return true in all cases since this {@code LoginModule} * should not be ignored. */ public boolean logout() throws LoginException { diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/LdapLoginModule.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/LdapLoginModule.java index 1de82aa98b6..167530a4b79 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/LdapLoginModule.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/LdapLoginModule.java @@ -70,8 +70,8 @@ import com.sun.security.auth.UserPrincipal; * conjunction with a specified search filter. * If successful then authentication is attempted using the user's * distinguished name and the supplied password. - * To enable this mode, set the userFilter option and omit the - * authIdentity option. + * To enable this mode, set the {@code userFilter} option and omit the + * {@code authIdentity} option. * Use search-first mode when the user's distinguished name is not * known in advance. * @@ -79,22 +79,22 @@ import com.sun.security.auth.UserPrincipal; * supplied username and password and then the LDAP directory is searched. * If authentication is successful then a search is performed using the * supplied username in conjunction with a specified search filter. - * To enable this mode, set the authIdentity and the - * userFilter options. + * To enable this mode, set the {@code authIdentity} and the + * {@code userFilter} options. * Use authentication-first mode when accessing an LDAP directory * that has been configured to disallow anonymous searches. * *

      In authentication-only mode, authentication is attempted using the * supplied username and password. The LDAP directory is not searched because * the user's distinguished name is already known. - * To enable this mode, set the authIdentity option to a valid - * distinguished name and omit the userFilter option. + * To enable this mode, set the {@code authIdentity} option to a valid + * distinguished name and omit the {@code userFilter} option. * Use authentication-only mode when the user's distinguished name is * known in advance. * *

      The following option is mandatory and must be specified in this * module's login {@link Configuration}: - *

      + *
      *
      *
      userProvider=ldap_urls *
      @@ -106,7 +106,7 @@ import com.sun.security.auth.UserPrincipal; * When several LDAP URLs are specified then each is attempted, * in turn, until the first successful connection is established. * Spaces in the distinguished name component of the URL must be escaped - * using the standard mechanism of percent character ('%') + * using the standard mechanism of percent character ('{@code %}') * followed by two hexadecimal digits (see {@link java.net.URI}). * Query components must also be omitted from the URL. * @@ -120,33 +120,33 @@ import com.sun.security.auth.UserPrincipal; * *

      This module also recognizes the following optional {@link Configuration} * options: - *

      + *
      *
      *
      userFilter=ldap_filter
      *
      This option specifies the search filter to use to locate a user's * entry in the LDAP directory. It is used to determine a user's * distinguished name. - * ldap_filter is an LDAP filter string + * {@code ldap_filter} is an LDAP filter string * (RFC 2254). - * If it contains the special token "{USERNAME}" + * If it contains the special token "{@code {USERNAME}}" * then that token will be replaced with the supplied username value * before the filter is used to search the directory.
      * *
      authIdentity=auth_id
      *
      This option specifies the identity to use when authenticating a user * to the LDAP directory. - * auth_id may be an LDAP distinguished name string + * {@code auth_id} may be an LDAP distinguished name string * (RFC 2253) or some * other string name. - * It must contain the special token "{USERNAME}" + * It must contain the special token "{@code {USERNAME}}" * which will be replaced with the supplied username value before the * name is used for authentication. * Note that if this option does not contain a distinguished name then - * the userFilter option must also be specified.
      + * the {@code userFilter} option must also be specified.
      * *
      authzIdentity=authz_id
      *
      This option specifies an authorization identity for the user. - * authz_id is any string name. + * {@code authz_id} is any string name. * If it comprises a single special token with curly braces then * that token is treated as a attribute name and will be replaced with a * single value of that attribute from the user's LDAP entry. @@ -156,23 +156,23 @@ import com.sun.security.auth.UserPrincipal; * is created using the authorization identity and it is associated with * the current {@link Subject}.
      * - *
      useSSL
      - *
      if false, this module does not establish an SSL connection + *
      {@code useSSL}
      + *
      if {@code false}, this module does not establish an SSL connection * to the LDAP server before attempting authentication. SSL is used to * protect the privacy of the user's password because it is transmitted * in the clear over LDAP. * By default, this module uses SSL.
      * - *
      useFirstPass
      - *
      if true, this module retrieves the username and password + *
      {@code useFirstPass}
      + *
      if {@code true}, this module retrieves the username and password * from the module's shared state, using "javax.security.auth.login.name" * and "javax.security.auth.login.password" as the respective keys. The * retrieved values are used for authentication. If authentication fails, * no attempt for a retry is made, and the failure is reported back to * the calling application.
      * - *
      tryFirstPass
      - *
      if true, this module retrieves the username and password + *
      {@code tryFirstPass}
      + *
      if {@code true}, this module retrieves the username and password * from the module's shared state, using "javax.security.auth.login.name" * and "javax.security.auth.login.password" as the respective keys. The * retrieved values are used for authentication. If authentication fails, @@ -181,8 +181,8 @@ import com.sun.security.auth.UserPrincipal; * authentication fails, the failure is reported back to the calling * application.
      * - *
      storePass
      - *
      if true, this module stores the username and password + *
      {@code storePass}
      + *
      if {@code true}, this module stores the username and password * obtained from the {@link CallbackHandler} in the module's shared state, * using * "javax.security.auth.login.name" and @@ -190,13 +190,13 @@ import com.sun.security.auth.UserPrincipal; * not performed if existing values already exist for the username and * password in the shared state, or if authentication fails.
      * - *
      clearPass
      - *
      if true, this module clears the username and password + *
      {@code clearPass}
      + *
      if {@code true}, this module clears the username and password * stored in the module's shared state after both phases of authentication * (login and commit) have completed.
      * - *
      debug
      - *
      if true, debug messages are displayed on the standard + *
      {@code debug}
      + *
      if {@code true}, debug messages are displayed on the standard * output stream. *
      *
      @@ -209,36 +209,36 @@ import com.sun.security.auth.UserPrincipal; * Note that the following four JNDI properties are set by this module directly * and are ignored if also present in the configuration: *
        - *
      • java.naming.provider.url - *
      • java.naming.security.principal - *
      • java.naming.security.credentials - *
      • java.naming.security.protocol + *
      • {@code java.naming.provider.url} + *
      • {@code java.naming.security.principal} + *
      • {@code java.naming.security.credentials} + *
      • {@code java.naming.security.protocol} *
      * *

      * Three sample {@link Configuration}s are shown below. * The first one activates search-first mode. It identifies the LDAP server - * and specifies that users' entries be located by their uid and - * objectClass attributes. It also specifies that an identity - * based on the user's employeeNumber attribute should be created. + * and specifies that users' entries be located by their {@code uid} and + * {@code objectClass} attributes. It also specifies that an identity + * based on the user's {@code employeeNumber} attribute should be created. * The second one activates authentication-first mode. It requests that the * LDAP server be located dynamically, that authentication be performed using * the supplied username directly but without the protection of SSL and that * users' entries be located by one of three naming attributes and their - * objectClass attribute. + * {@code objectClass} attribute. * The third one activates authentication-only mode. It identifies alternative * LDAP servers, it specifies the distinguished name to use for * authentication and a fixed identity to use for authorization. No directory * search is performed. * - *

      + * 
      {@literal
        *
        *     ExampleApplication {
        *         com.sun.security.auth.module.LdapLoginModule REQUIRED
      - *             userProvider="ldap://ldap-svr/ou=people,dc=example,dc=com"
      - *             userFilter="(&(uid={USERNAME})(objectClass=inetOrgPerson))"
      - *             authzIdentity="{EMPLOYEENUMBER}"
      - *             debug=true;
      + *              userProvider="ldap://ldap-svr/ou=people,dc=example,dc=com"
      + *              userFilter="(&(uid={USERNAME})(objectClass=inetOrgPerson))"
      + *              authzIdentity="{EMPLOYEENUMBER}"
      + *              debug=true;
        *     };
        *
        *     ExampleApplication {
      @@ -258,7 +258,7 @@ import com.sun.security.auth.UserPrincipal;
        *             debug=true;
        *     };
        *
      - * 
      + * }
      * *
      *
      Note:
      @@ -282,7 +282,6 @@ import com.sun.security.auth.UserPrincipal; * caller-specified {@link Configuration} then the application * must be granted the permissions required by the {@link LoginModule}. * This module requires the following two permissions: - *

      *

        *
      • The {@link SocketPermission} to connect to an LDAP server. *
      • The {@link AuthPermission} to modify the set of {@link Principal}s @@ -373,15 +372,15 @@ public class LdapLoginModule implements LoginModule { private SearchControls constraints = null; /** - * Initialize this LoginModule. + * Initialize this {@code LoginModule}. * - * @param subject the Subject to be authenticated. - * @param callbackHandler a CallbackHandler to acquire the + * @param subject the {@code Subject} to be authenticated. + * @param callbackHandler a {@code CallbackHandler} to acquire the * username and password. - * @param sharedState shared LoginModule state. + * @param sharedState shared {@code LoginModule} state. * @param options options specified in the login - * Configuration for this particular - * LoginModule. + * {@code Configuration} for this particular + * {@code LoginModule}. */ // Unchecked warning from (Map)sharedState is safe // since javax.security.auth.login.LoginContext passes a raw HashMap. @@ -492,10 +491,10 @@ public class LdapLoginModule implements LoginModule { *

        Acquire the user's credentials and verify them against the * specified LDAP directory. * - * @return true always, since this LoginModule + * @return true always, since this {@code LoginModule} * should not be ignored. * @exception FailedLoginException if the authentication fails. - * @exception LoginException if this LoginModule + * @exception LoginException if this {@code LoginModule} * is unable to perform the authentication. */ public boolean login() throws LoginException { @@ -593,10 +592,10 @@ public class LdapLoginModule implements LoginModule { * *

        If this LoginModule's own authentication attempt * succeeded (checked by retrieving the private state saved by the - * login method), then this method associates an - * LdapPrincipal and one or more UserPrincipals - * with the Subject located in the - * LoginModule. If this LoginModule's own + * {@code login} method), then this method associates an + * {@code LdapPrincipal} and one or more {@code UserPrincipal}s + * with the {@code Subject} located in the + * {@code LoginModule}. If this LoginModule's own * authentication attempted failed, then this method removes * any state that was originally saved. * @@ -662,7 +661,7 @@ public class LdapLoginModule implements LoginModule { * *

        If this LoginModule's own authentication attempt * succeeded (checked by retrieving the private state saved by the - * login and commit methods), + * {@code login} and {@code commit} methods), * then this method cleans up any state that was originally saved. * * @exception LoginException if the abort fails. @@ -697,10 +696,10 @@ public class LdapLoginModule implements LoginModule { * Logout a user. * *

        This method removes the Principals - * that were added by the commit method. + * that were added by the {@code commit} method. * * @exception LoginException if the logout fails. - * @return true in all cases since this LoginModule + * @return true in all cases since this {@code LoginModule} * should not be ignored. */ public boolean logout() throws LoginException { diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/NTLoginModule.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/NTLoginModule.java index d228b0550f2..828b5b9f748 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/NTLoginModule.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/NTLoginModule.java @@ -41,10 +41,10 @@ import com.sun.security.auth.NTSidGroupPrincipal; import com.sun.security.auth.NTNumericCredential; /** - *

        This LoginModule + * This {@code LoginModule} * renders a user's NT security information as some number of - * Principals - * and associates them with a Subject. + * {@code Principal}s + * and associates them with a {@code Subject}. * *

        This LoginModule recognizes the debug option. * If set to true in the login Configuration, @@ -85,23 +85,21 @@ public class NTLoginModule implements LoginModule { private NTNumericCredential iToken; // impersonation token /** - * Initialize this LoginModule. + * Initialize this {@code LoginModule}. * - *

        + * @param subject the {@code Subject} to be authenticated. * - * @param subject the Subject to be authenticated.

        - * - * @param callbackHandler a CallbackHandler for communicating + * @param callbackHandler a {@code CallbackHandler} for communicating * with the end user (prompting for usernames and * passwords, for example). This particular LoginModule only * extracts the underlying NT system information, so this - * parameter is ignored.

        + * parameter is ignored. * - * @param sharedState shared LoginModule state.

        + * @param sharedState shared {@code LoginModule} state. * * @param options options specified in the login - * Configuration for this particular - * LoginModule. + * {@code Configuration} for this particular + * {@code LoginModule}. */ public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, @@ -125,14 +123,12 @@ public class NTLoginModule implements LoginModule { /** * Import underlying NT system identity information. * - *

        - * - * @return true in all cases since this LoginModule + * @return true in all cases since this {@code LoginModule} * should not be ignored. * - * @exception FailedLoginException if the authentication fails.

        + * @exception FailedLoginException if the authentication fails. * - * @exception LoginException if this LoginModule + * @exception LoginException if this {@code LoginModule} * is unable to perform the authentication. */ public boolean login() throws LoginException { @@ -221,22 +217,20 @@ public class NTLoginModule implements LoginModule { } /** - *

        This method is called if the LoginContext's + * This method is called if the LoginContext's * overall authentication succeeded * (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules * succeeded). * *

        If this LoginModule's own authentication attempt * succeeded (checked by retrieving the private state saved by the - * login method), then this method associates some - * number of various Principals - * with the Subject located in the - * LoginModuleContext. If this LoginModule's own + * {@code login} method), then this method associates some + * number of various {@code Principal}s + * with the {@code Subject} located in the + * {@code LoginModuleContext}. If this LoginModule's own * authentication attempted failed, then this method removes * any state that was originally saved. * - *

        - * * @exception LoginException if the commit fails. * * @return true if this LoginModule's own login and commit @@ -290,18 +284,16 @@ public class NTLoginModule implements LoginModule { /** - *

        This method is called if the LoginContext's + * This method is called if the LoginContext's * overall authentication failed. * (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules * did not succeed). * *

        If this LoginModule's own authentication attempt * succeeded (checked by retrieving the private state saved by the - * login and commit methods), + * {@code login} and {@code commit} methods), * then this method cleans up any state that was originally saved. * - *

        - * * @exception LoginException if the abort fails. * * @return false if this LoginModule's own login and/or commit attempts @@ -336,17 +328,15 @@ public class NTLoginModule implements LoginModule { /** * Logout the user. * - *

        This method removes the NTUserPrincipal, - * NTDomainPrincipal, NTSidUserPrincipal, - * NTSidDomainPrincipal, NTSidGroupPrincipals, - * and NTSidPrimaryGroupPrincipal - * that may have been added by the commit method. - * - *

        + *

        This method removes the {@code NTUserPrincipal}, + * {@code NTDomainPrincipal}, {@code NTSidUserPrincipal}, + * {@code NTSidDomainPrincipal}, {@code NTSidGroupPrincipal}s, + * and {@code NTSidPrimaryGroupPrincipal} + * that may have been added by the {@code commit} method. * * @exception LoginException if the logout fails. * - * @return true in all cases since this LoginModule + * @return true in all cases since this {@code LoginModule} * should not be ignored. */ public boolean logout() throws LoginException { diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/NTSystem.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/NTSystem.java index 0a51492d620..54fa4c23348 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/NTSystem.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/NTSystem.java @@ -26,7 +26,7 @@ package com.sun.security.auth.module; /** - *

        This class implementation retrieves and makes available NT + * This class implementation retrieves and makes available NT * security information for the current user. * */ @@ -45,7 +45,7 @@ public class NTSystem { private long impersonationToken; /** - * Instantiate an NTSystem and load + * Instantiate an {@code NTSystem} and load * the native library to access the underlying system information. */ public NTSystem() { @@ -53,7 +53,7 @@ public class NTSystem { } /** - * Instantiate an NTSystem and load + * Instantiate an {@code NTSystem} and load * the native library to access the underlying system information. */ NTSystem(boolean debug) { @@ -64,8 +64,6 @@ public class NTSystem { /** * Get the username for the current NT user. * - *

        - * * @return the username for the current NT user. */ public String getName() { @@ -75,8 +73,6 @@ public class NTSystem { /** * Get the domain for the current NT user. * - *

        - * * @return the domain for the current NT user. */ public String getDomain() { @@ -86,8 +82,6 @@ public class NTSystem { /** * Get a printable SID for the current NT user's domain. * - *

        - * * @return a printable SID for the current NT user's domain. */ public String getDomainSID() { @@ -97,8 +91,6 @@ public class NTSystem { /** * Get a printable SID for the current NT user. * - *

        - * * @return a printable SID for the current NT user. */ public String getUserSID() { @@ -108,8 +100,6 @@ public class NTSystem { /** * Get a printable primary group SID for the current NT user. * - *

        - * * @return the primary group SID for the current NT user. */ public String getPrimaryGroupID() { @@ -119,8 +109,6 @@ public class NTSystem { /** * Get the printable group SIDs for the current NT user. * - *

        - * * @return the group SIDs for the current NT user. */ public String[] getGroupIDs() { @@ -130,8 +118,6 @@ public class NTSystem { /** * Get an impersonation token for the current NT user. * - *

        - * * @return an impersonation token for the current NT user. */ public synchronized long getImpersonationToken() { diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/SolarisLoginModule.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/SolarisLoginModule.java index 0b71ac4ce77..9b5adb0c3cf 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/SolarisLoginModule.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/SolarisLoginModule.java @@ -36,17 +36,17 @@ import com.sun.security.auth.SolarisNumericUserPrincipal; import com.sun.security.auth.SolarisNumericGroupPrincipal; /** - *

        This LoginModule imports a user's Solaris - * Principal information (SolarisPrincipal, - * SolarisNumericUserPrincipal, - * and SolarisNumericGroupPrincipal) - * and associates them with the current Subject. + * This {@code LoginModule} imports a user's Solaris + * {@code Principal} information ({@code SolarisPrincipal}, + * {@code SolarisNumericUserPrincipal}, + * and {@code SolarisNumericGroupPrincipal}) + * and associates them with the current {@code Subject}. * *

        This LoginModule recognizes the debug option. * If set to true in the login Configuration, * debug messages will be output to the output stream, System.out. * @deprecated As of JDK1.4, replaced by - * com.sun.security.auth.module.UnixLoginModule. + * {@code com.sun.security.auth.module.UnixLoginModule}. * This LoginModule is entirely deprecated and * is here to allow for a smooth transition to the new * UnixLoginModule. @@ -80,21 +80,19 @@ public class SolarisLoginModule implements LoginModule { new LinkedList<>(); /** - * Initialize this LoginModule. + * Initialize this {@code LoginModule}. * - *

        + * @param subject the {@code Subject} to be authenticated. * - * @param subject the Subject to be authenticated.

        - * - * @param callbackHandler a CallbackHandler for communicating + * @param callbackHandler a {@code CallbackHandler} for communicating * with the end user (prompting for usernames and - * passwords, for example).

        + * passwords, for example). * - * @param sharedState shared LoginModule state.

        + * @param sharedState shared {@code LoginModule} state. * * @param options options specified in the login - * Configuration for this particular - * LoginModule. + * {@code Configuration} for this particular + * {@code LoginModule}. */ public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, @@ -114,15 +112,13 @@ public class SolarisLoginModule implements LoginModule { * Authenticate the user (first phase). * *

        The implementation of this method attempts to retrieve the user's - * Solaris Subject information by making a native Solaris + * Solaris {@code Subject} information by making a native Solaris * system call. * - *

        - * * @exception FailedLoginException if attempts to retrieve the underlying * system information fail. * - * @return true in all cases (this LoginModule + * @return true in all cases (this {@code LoginModule} * should not be ignored). */ public boolean login() throws LoginException { @@ -175,13 +171,11 @@ public class SolarisLoginModule implements LoginModule { *

        If this LoginModule's own authentication attempt * succeeded (the importing of the Solaris authentication information * succeeded), then this method associates the Solaris Principals - * with the Subject currently tied to the - * LoginModule. If this LoginModule's + * with the {@code Subject} currently tied to the + * {@code LoginModule}. If this LoginModule's * authentication attempted failed, then this method removes * any state that was originally saved. * - *

        - * * @exception LoginException if the commit fails * * @return true if this LoginModule's own login and commit attempts @@ -232,10 +226,8 @@ public class SolarisLoginModule implements LoginModule { * did not succeed). * *

        This method cleans up any state that was originally saved - * as part of the authentication attempt from the login - * and commit methods. - * - *

        + * as part of the authentication attempt from the {@code login} + * and {@code commit} methods. * * @exception LoginException if the abort fails * @@ -272,13 +264,11 @@ public class SolarisLoginModule implements LoginModule { * Logout the user * *

        This method removes the Principals associated - * with the Subject. - * - *

        + * with the {@code Subject}. * * @exception LoginException if the logout fails * - * @return true in all cases (this LoginModule + * @return true in all cases (this {@code LoginModule} * should not be ignored). */ public boolean logout() throws LoginException { diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/SolarisSystem.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/SolarisSystem.java index f06f28c22dd..98f6f4c70a0 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/SolarisSystem.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/SolarisSystem.java @@ -26,7 +26,7 @@ package com.sun.security.auth.module; /** - *

        This class implementation retrieves and makes available Solaris + * This class implementation retrieves and makes available Solaris * UID/GID/groups information for the current user. * * @deprecated replaced by {@link UnixSystem}. @@ -43,7 +43,7 @@ public class SolarisSystem { protected long[] groups; /** - * Instantiate a SolarisSystem and load + * Instantiate a {@code SolarisSystem} and load * the native library to access the underlying system information. */ public SolarisSystem() { @@ -54,8 +54,6 @@ public class SolarisSystem { /** * Get the username for the current Solaris user. * - *

        - * * @return the username for the current Solaris user. */ public String getUsername() { @@ -65,8 +63,6 @@ public class SolarisSystem { /** * Get the UID for the current Solaris user. * - *

        - * * @return the UID for the current Solaris user. */ public long getUid() { @@ -76,8 +72,6 @@ public class SolarisSystem { /** * Get the GID for the current Solaris user. * - *

        - * * @return the GID for the current Solaris user. */ public long getGid() { @@ -87,8 +81,6 @@ public class SolarisSystem { /** * Get the supplementary groups for the current Solaris user. * - *

        - * * @return the supplementary groups for the current Solaris user. */ public long[] getGroups() { diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixLoginModule.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixLoginModule.java index 8123ba68e9d..704b11dc33c 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixLoginModule.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixLoginModule.java @@ -36,11 +36,11 @@ import com.sun.security.auth.UnixNumericUserPrincipal; import com.sun.security.auth.UnixNumericGroupPrincipal; /** - *

        This LoginModule imports a user's Unix - * Principal information (UnixPrincipal, - * UnixNumericUserPrincipal, - * and UnixNumericGroupPrincipal) - * and associates them with the current Subject. + * This {@code LoginModule} imports a user's Unix + * {@code Principal} information ({@code UnixPrincipal}, + * {@code UnixNumericUserPrincipal}, + * and {@code UnixNumericGroupPrincipal}) + * and associates them with the current {@code Subject}. * *

        This LoginModule recognizes the debug option. * If set to true in the login Configuration, @@ -74,21 +74,19 @@ public class UnixLoginModule implements LoginModule { new LinkedList<>(); /** - * Initialize this LoginModule. + * Initialize this {@code LoginModule}. * - *

        + * @param subject the {@code Subject} to be authenticated. * - * @param subject the Subject to be authenticated.

        - * - * @param callbackHandler a CallbackHandler for communicating + * @param callbackHandler a {@code CallbackHandler} for communicating * with the end user (prompting for usernames and - * passwords, for example).

        + * passwords, for example). * - * @param sharedState shared LoginModule state.

        + * @param sharedState shared {@code LoginModule} state. * * @param options options specified in the login - * Configuration for this particular - * LoginModule. + * {@code Configuration} for this particular + * {@code LoginModule}. */ public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, @@ -107,15 +105,13 @@ public class UnixLoginModule implements LoginModule { * Authenticate the user (first phase). * *

        The implementation of this method attempts to retrieve the user's - * Unix Subject information by making a native Unix + * Unix {@code Subject} information by making a native Unix * system call. * - *

        - * * @exception FailedLoginException if attempts to retrieve the underlying * system information fail. * - * @return true in all cases (this LoginModule + * @return true in all cases (this {@code LoginModule} * should not be ignored). */ public boolean login() throws LoginException { @@ -169,13 +165,11 @@ public class UnixLoginModule implements LoginModule { *

        If this LoginModule's own authentication attempt * succeeded (the importing of the Unix authentication information * succeeded), then this method associates the Unix Principals - * with the Subject currently tied to the - * LoginModule. If this LoginModule's + * with the {@code Subject} currently tied to the + * {@code LoginModule}. If this LoginModule's * authentication attempted failed, then this method removes * any state that was originally saved. * - *

        - * * @exception LoginException if the commit fails * * @return true if this LoginModule's own login and commit attempts @@ -228,10 +222,8 @@ public class UnixLoginModule implements LoginModule { * did not succeed). * *

        This method cleans up any state that was originally saved - * as part of the authentication attempt from the login - * and commit methods. - * - *

        + * as part of the authentication attempt from the {@code login} + * and {@code commit} methods. * * @exception LoginException if the abort fails * @@ -267,13 +259,11 @@ public class UnixLoginModule implements LoginModule { * Logout the user * *

        This method removes the Principals associated - * with the Subject. - * - *

        + * with the {@code Subject}. * * @exception LoginException if the logout fails * - * @return true in all cases (this LoginModule + * @return true in all cases (this {@code LoginModule} * should not be ignored). */ public boolean logout() throws LoginException { diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixSystem.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixSystem.java index f969ae1dd10..43f93f78e82 100644 --- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixSystem.java +++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixSystem.java @@ -26,9 +26,8 @@ package com.sun.security.auth.module; /** - *

        This class implementation retrieves and makes available Unix + * This class implementation retrieves and makes available Unix * UID/GID/groups information for the current user. - * */ @jdk.Exported public class UnixSystem { @@ -41,7 +40,7 @@ public class UnixSystem { protected long[] groups; /** - * Instantiate a UnixSystem and load + * Instantiate a {@code UnixSystem} and load * the native library to access the underlying system information. */ public UnixSystem() { @@ -52,8 +51,6 @@ public class UnixSystem { /** * Get the username for the current Unix user. * - *

        - * * @return the username for the current Unix user. */ public String getUsername() { @@ -63,8 +60,6 @@ public class UnixSystem { /** * Get the UID for the current Unix user. * - *

        - * * @return the UID for the current Unix user. */ public long getUid() { @@ -74,8 +69,6 @@ public class UnixSystem { /** * Get the GID for the current Unix user. * - *

        - * * @return the GID for the current Unix user. */ public long getGid() { @@ -85,8 +78,6 @@ public class UnixSystem { /** * Get the supplementary groups for the current Unix user. * - *

        - * * @return the supplementary groups for the current Unix user. */ public long[] getGroups() { From 84bc5a8a04577298dbe7cb81fe57546e02202546 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Wed, 29 Apr 2015 08:37:57 -0700 Subject: [PATCH 7/7] 8078880: Mark a few more intermittently failuring security-libs Reviewed-by: xuelei --- jdk/test/sun/security/mscapi/SignUsingSHA2withRSA.sh | 1 + jdk/test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java | 1 + 2 files changed, 2 insertions(+) diff --git a/jdk/test/sun/security/mscapi/SignUsingSHA2withRSA.sh b/jdk/test/sun/security/mscapi/SignUsingSHA2withRSA.sh index 2d433f108f0..d70a4e1c973 100644 --- a/jdk/test/sun/security/mscapi/SignUsingSHA2withRSA.sh +++ b/jdk/test/sun/security/mscapi/SignUsingSHA2withRSA.sh @@ -28,6 +28,7 @@ # @bug 6753664 # @run shell SignUsingSHA2withRSA.sh # @summary Support SHA256 (and higher) in SunMSCAPI +# @key intermittent # set a few environment variables so that the shell-script can run stand-alone # in the source directory diff --git a/jdk/test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java b/jdk/test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java index 92eb0f91b93..89ca783dc50 100644 --- a/jdk/test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java +++ b/jdk/test/sun/security/pkcs11/rsa/TestKeyPairGenerator.java @@ -28,6 +28,7 @@ * @author Andreas Sterbenz * @library .. * @run main/othervm TestKeyPairGenerator + * @key intermittent */ import java.io.*;

    7. Request URIMatches context
      "http://foo.com/apps/foo/bar"ctx3