# HG changeset patch
# User tbell
# Date 1233386840 28800
# Node ID d3de53b2070d2aa73436d5526a3ae0181da3f640
# Parent 7e90efb5bee6856ed2014e4eb9ba0f7fbcdd5dd7# Parent bdfd8f01987a629db28ed5018de072ece3747036
Merge
diff -r 7e90efb5bee6 -r d3de53b2070d jdk/src/share/classes/java/io/InputStream.java
--- a/jdk/src/share/classes/java/io/InputStream.java Thu Jan 29 21:46:48 2009 -0800
+++ b/jdk/src/share/classes/java/io/InputStream.java Fri Jan 30 23:27:20 2009 -0800
@@ -90,7 +90,7 @@
*
* @param b the buffer into which the data is read.
* @return the total number of bytes read into the buffer, or
- * -1
is there is no more data because the end of
+ * -1
if there is no more data because the end of
* the stream has been reached.
* @exception IOException If the first byte cannot be read for any reason
* other than the end of the file, if the input stream has been closed, or
diff -r 7e90efb5bee6 -r d3de53b2070d jdk/src/share/classes/java/lang/Enum.java
--- a/jdk/src/share/classes/java/lang/Enum.java Thu Jan 29 21:46:48 2009 -0800
+++ b/jdk/src/share/classes/java/lang/Enum.java Fri Jan 30 23:27:20 2009 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,11 @@
/**
* This is the common base class of all Java language enumeration types.
*
+ * More information about enums, including implicit methods synthesised
+ * by the compiler, can be found in The Java™ Language
+ * Specification, Third Edition, §8.9.
+ *
* @author Josh Bloch
* @author Neal Gafter
* @see Class#getEnumConstants()
@@ -212,7 +217,7 @@
if (name == null)
throw new NullPointerException("Name is null");
throw new IllegalArgumentException(
- "No enum const " + enumType +"." + name);
+ "No enum constant " + enumType.getCanonicalName() + "." + name);
}
/**
@@ -225,10 +230,10 @@
*/
private void readObject(ObjectInputStream in) throws IOException,
ClassNotFoundException {
- throw new InvalidObjectException("can't deserialize enum");
+ throw new InvalidObjectException("can't deserialize enum");
}
private void readObjectNoData() throws ObjectStreamException {
- throw new InvalidObjectException("can't deserialize enum");
+ throw new InvalidObjectException("can't deserialize enum");
}
}
diff -r 7e90efb5bee6 -r d3de53b2070d jdk/src/share/classes/java/lang/Object.java
--- a/jdk/src/share/classes/java/lang/Object.java Thu Jan 29 21:46:48 2009 -0800
+++ b/jdk/src/share/classes/java/lang/Object.java Fri Jan 30 23:27:20 2009 -0800
@@ -26,8 +26,8 @@
package java.lang;
/**
- * Class Object
is the root of the class hierarchy.
- * Every class has Object
as a superclass. All objects,
+ * Class {@code Object} is the root of the class hierarchy.
+ * Every class has {@code Object} as a superclass. All objects,
* including arrays, implement the methods of this class.
*
* @author unascribed
@@ -66,30 +66,30 @@
/**
* Returns a hash code value for the object. This method is
- * supported for the benefit of hashtables such as those provided by
- * java.util.Hashtable
.
+ * supported for the benefit of hash tables such as those provided by
+ * {@link java.util.HashMap}.
*
- * The general contract of hashCode
is:
+ * The general contract of {@code hashCode} is:
*
hashCode
method on each of
+ * * As much as is reasonably practical, the hashCode method defined by - * class Object does return distinct integers for distinct + * class {@code Object} does return distinct integers for distinct * objects. (This is typically implemented by converting the internal * address of the object into an integer, but this implementation * technique is not required by the @@ -97,55 +97,55 @@ * * @return a hash code value for this object. * @see java.lang.Object#equals(java.lang.Object) - * @see java.util.Hashtable + * @see java.lang.System#identityHashCode */ public native int hashCode(); /** * Indicates whether some other object is "equal to" this one. *
- * The equals
method implements an equivalence relation
+ * The {@code equals} method implements an equivalence relation
* on non-null object references:
*
x
, x.equals(x)
should return
- * true
.
+ * {@code x}, {@code x.equals(x)} should return
+ * {@code true}.
* x
and y
, x.equals(y)
- * should return true
if and only if
- * y.equals(x)
returns true
.
+ * {@code x} and {@code y}, {@code x.equals(y)}
+ * should return {@code true} if and only if
+ * {@code y.equals(x)} returns {@code true}.
* x
, y
, and z
, if
- * x.equals(y)
returns true
and
- * y.equals(z)
returns true
, then
- * x.equals(z)
should return true
.
+ * {@code x}, {@code y}, and {@code z}, if
+ * {@code x.equals(y)} returns {@code true} and
+ * {@code y.equals(z)} returns {@code true}, then
+ * {@code x.equals(z)} should return {@code true}.
* x
and y
, multiple invocations of
- * x.equals(y) consistently return true
- * or consistently return false
, provided no
- * information used in equals
comparisons on the
+ * {@code x} and {@code y}, multiple invocations of
+ * {@code x.equals(y)} consistently return {@code true}
+ * or consistently return {@code false}, provided no
+ * information used in {@code equals} comparisons on the
* objects is modified.
- * x
,
- * x.equals(null)
should return false
.
+ *
- * The equals method for class Object
implements
+ * The {@code equals} method for class {@code Object} implements
* the most discriminating possible equivalence relation on objects;
- * that is, for any non-null reference values x
and
- * y
, this method returns true
if and only
- * if x
and y
refer to the same object
- * (x == y
has the value true
).
+ * that is, for any non-null reference values {@code x} and
+ * {@code y}, this method returns {@code true} if and only
+ * if {@code x} and {@code y} refer to the same object
+ * ({@code x == y} has the value {@code true}).
*
- * Note that it is generally necessary to override the hashCode
+ * Note that it is generally necessary to override the {@code hashCode}
* method whenever this method is overridden, so as to maintain the
- * general contract for the hashCode method, which states
+ * general contract for the {@code hashCode} method, which states
* that equal objects must have equal hash codes.
*
* @param obj the reference object with which to compare.
- * @return true
if this object is the same as the obj
- * argument; false
otherwise.
+ * @return {@code true} if this object is the same as the obj
+ * argument; {@code false} otherwise.
* @see #hashCode()
- * @see java.util.Hashtable
+ * @see java.util.HashMap
*/
public boolean equals(Object obj) {
return (this == obj);
@@ -154,7 +154,7 @@
/**
* Creates and returns a copy of this object. The precise meaning
* of "copy" may depend on the class of the object. The general
- * intent is that, for any object x, the expression:
+ * intent is that, for any object {@code x}, the expression:
*
*@@ -162,49 +162,49 @@ ** x.clone() != x
*- * will be true, but these are not absolute requirements. + * will be {@code true}, but these are not absolute requirements. * While it is typically the case that: ** x.clone().getClass() == x.getClass()
*- * will be true, this is not an absolute requirement. + * will be {@code true}, this is not an absolute requirement. ** x.clone().equals(x)
* By convention, the returned object should be obtained by calling - * super.clone. If a class and all of its superclasses (except - * Object) obey this convention, it will be the case that - * x.clone().getClass() == x.getClass(). + * {@code super.clone}. If a class and all of its superclasses (except + * {@code Object}) obey this convention, it will be the case that + * {@code x.clone().getClass() == x.getClass()}. *
* By convention, the object returned by this method should be independent * of this object (which is being cloned). To achieve this independence, * it may be necessary to modify one or more fields of the object returned - * by super.clone before returning it. Typically, this means + * by {@code super.clone} before returning it. Typically, this means * copying any mutable objects that comprise the internal "deep structure" * of the object being cloned and replacing the references to these * objects with references to the copies. If a class contains only * primitive fields or references to immutable objects, then it is usually - * the case that no fields in the object returned by super.clone + * the case that no fields in the object returned by {@code super.clone} * need to be modified. *
- * The method clone for class Object performs a + * The method {@code clone} for class {@code Object} performs a * specific cloning operation. First, if the class of this object does - * not implement the interface Cloneable, then a - * CloneNotSupportedException is thrown. Note that all arrays - * are considered to implement the interface Cloneable. + * not implement the interface {@code Cloneable}, then a + * {@code CloneNotSupportedException} is thrown. Note that all arrays + * are considered to implement the interface {@code Cloneable}. * Otherwise, this method creates a new instance of the class of this * object and initializes all its fields with exactly the contents of * the corresponding fields of this object, as if by assignment; the * contents of the fields are not themselves cloned. Thus, this method * performs a "shallow copy" of this object, not a "deep copy" operation. *
- * The class Object does not itself implement the interface
- * Cloneable, so calling the clone method on an object
- * whose class is Object will result in throwing an
+ * The class {@code Object} does not itself implement the interface
+ * {@code Cloneable}, so calling the {@code clone} method on an object
+ * whose class is {@code Object} will result in throwing an
* exception at run time.
*
* @return a clone of this instance.
* @exception CloneNotSupportedException if the object's class does not
- * support the Cloneable
interface. Subclasses
- * that override the clone
method can also
+ * support the {@code Cloneable} interface. Subclasses
+ * that override the {@code clone} method can also
* throw this exception to indicate that an instance cannot
* be cloned.
* @see java.lang.Cloneable
@@ -213,15 +213,15 @@
/**
* Returns a string representation of the object. In general, the
- * toString
method returns a string that
+ * {@code toString} method returns a string that
* "textually represents" this object. The result should
* be a concise but informative representation that is easy for a
* person to read.
* It is recommended that all subclasses override this method.
*
- * The toString
method for class Object
+ * The {@code toString} method for class {@code Object}
* returns a string consisting of the name of the class of which the
- * object is an instance, the at-sign character `@
', and
+ * object is an instance, the at-sign character `{@code @}', and
* the unsigned hexadecimal representation of the hash code of the
* object. In other words, this method returns a string equal to the
* value of:
@@ -241,7 +241,7 @@
* monitor. If any threads are waiting on this object, one of them
* is chosen to be awakened. The choice is arbitrary and occurs at
* the discretion of the implementation. A thread waits on an object's
- * monitor by calling one of the wait
methods.
+ * monitor by calling one of the {@code wait} methods.
*
* The awakened thread will not be able to proceed until the current * thread relinquishes the lock on this object. The awakened thread will @@ -255,9 +255,9 @@ * object's monitor in one of three ways: *
synchronized
statement
+ * Class,
by executing a
+ *
@@ -273,7 +273,7 @@
/**
* Wakes up all threads that are waiting on this object's monitor. A
* thread waits on an object's monitor by calling one of the
- * wait
methods.
+ * {@code wait} methods.
*
* The awakened threads will not be able to proceed until the current * thread relinquishes the lock on this object. The awakened threads @@ -283,7 +283,7 @@ * being the next thread to lock this object. *
* This method should only be called by a thread that is the owner
- * of this object's monitor. See the notify
method for a
+ * of this object's monitor. See the {@code notify} method for a
* description of the ways in which a thread can become the owner of
* a monitor.
*
@@ -308,15 +308,15 @@
* becomes disabled for thread scheduling purposes and lies dormant
* until one of four things happens:
*
* A thread can also wake up without being notified, interrupted, or @@ -351,18 +351,18 @@ * *
If the current thread is {@linkplain java.lang.Thread#interrupt() * interrupted} by any thread before or while it is waiting, then an - * InterruptedException is thrown. This exception is not + * {@code InterruptedException} is thrown. This exception is not * thrown until the lock status of this object has been restored as * described above. * *
- * Note that the wait method, as it places the current thread + * Note that the {@code wait} method, as it places the current thread * into the wait set for this object, unlocks only this object; any * other objects on which the current thread may be synchronized remain * locked while the thread waits. *
* This method should only be called by a thread that is the owner
- * of this object's monitor. See the notify
method for a
+ * of this object's monitor. See the {@code notify} method for a
* description of the ways in which a thread can become the owner of
* a monitor.
*
@@ -388,7 +388,7 @@
* some other thread interrupts the current thread, or a certain
* amount of real time has elapsed.
*
- * This method is similar to the wait
method of one
+ * This method is similar to the {@code wait} method of one
* argument, but it allows finer control over the amount of time to
* wait for a notification before giving up. The amount of real time,
* measured in nanoseconds, is given by:
@@ -398,17 +398,17 @@
*
* In all other respects, this method does the same thing as the * method {@link #wait(long)} of one argument. In particular, - * wait(0, 0) means the same thing as wait(0). + * {@code wait(0, 0)} means the same thing as {@code wait(0)}. *
* The current thread must own this object's monitor. The thread * releases ownership of this monitor and waits until either of the * following two conditions has occurred: *
notify
method
- * or the notifyAll
method.
- * timeout
- * milliseconds plus nanos
nanoseconds arguments, has
+ * to wake up either through a call to the {@code notify} method
+ * or the {@code notifyAll} method.
+ *
@@ -425,7 +425,7 @@
* }
*
* This method should only be called by a thread that is the owner
- * of this object's monitor. See the notify
method for a
+ * of this object's monitor. See the {@code notify} method for a
* description of the ways in which a thread can become the owner of
* a monitor.
*
@@ -465,13 +465,13 @@
* {@link java.lang.Object#notify()} method or the
* {@link java.lang.Object#notifyAll()} method for this object.
* In other words, this method behaves exactly as if it simply
- * performs the call wait(0).
+ * performs the call {@code wait(0)}.
*
* The current thread must own this object's monitor. The thread
* releases ownership of this monitor and waits until another thread
* notifies threads waiting on this object's monitor to wake up
- * either through a call to the notify
method or the
- * notifyAll
method. The thread then waits until it can
+ * either through a call to the {@code notify} method or the
+ * {@code notifyAll} method. The thread then waits until it can
* re-obtain ownership of the monitor and resumes execution.
*
* As in the one argument version, interrupts and spurious wakeups are
@@ -484,7 +484,7 @@
* }
*
* This method should only be called by a thread that is the owner
- * of this object's monitor. See the notify
method for a
+ * of this object's monitor. See the {@code notify} method for a
* description of the ways in which a thread can become the owner of
* a monitor.
*
@@ -505,49 +505,49 @@
/**
* Called by the garbage collector on an object when garbage collection
* determines that there are no more references to the object.
- * A subclass overrides the finalize
method to dispose of
+ * A subclass overrides the {@code finalize} method to dispose of
* system resources or to perform other cleanup.
*
- * The general contract of finalize is that it is invoked + * The general contract of {@code finalize} is that it is invoked * if and when the JavaTM virtual * machine has determined that there is no longer any * means by which this object can be accessed by any thread that has * not yet died, except as a result of an action taken by the * finalization of some other object or class which is ready to be - * finalized. The finalize method may take any action, including + * finalized. The {@code finalize} method may take any action, including * making this object available again to other threads; the usual purpose - * of finalize, however, is to perform cleanup actions before + * of {@code finalize}, however, is to perform cleanup actions before * the object is irrevocably discarded. For example, the finalize method * for an object that represents an input/output connection might perform * explicit I/O transactions to break the connection before the object is * permanently discarded. *
- * The finalize method of class Object performs no + * The {@code finalize} method of class {@code Object} performs no * special action; it simply returns normally. Subclasses of - * Object may override this definition. + * {@code Object} may override this definition. *
* The Java programming language does not guarantee which thread will - * invoke the finalize method for any given object. It is + * invoke the {@code finalize} method for any given object. It is * guaranteed, however, that the thread that invokes finalize will not * be holding any user-visible synchronization locks when finalize is * invoked. If an uncaught exception is thrown by the finalize method, * the exception is ignored and finalization of that object terminates. *
- * After the finalize method has been invoked for an object, no + * After the {@code finalize} method has been invoked for an object, no * further action is taken until the Java virtual machine has again * determined that there is no longer any means by which this object can * be accessed by any thread that has not yet died, including possible * actions by other objects or classes which are ready to be finalized, * at which point the object may be discarded. *
- * The finalize method is never invoked more than once by a Java + * The {@code finalize} method is never invoked more than once by a Java * virtual machine for any given object. *
- * Any exception thrown by the finalize
method causes
+ * Any exception thrown by the {@code finalize} method causes
* the finalization of this object to be halted, but is otherwise
* ignored.
*
- * @throws Throwable the Exception
raised by this method
+ * @throws Throwable the {@code Exception} raised by this method
*/
protected void finalize() throws Throwable { }
}
diff -r 7e90efb5bee6 -r d3de53b2070d jdk/src/share/classes/java/lang/RuntimePermission.java
--- a/jdk/src/share/classes/java/lang/RuntimePermission.java Thu Jan 29 21:46:48 2009 -0800
+++ b/jdk/src/share/classes/java/lang/RuntimePermission.java Fri Jan 30 23:27:20 2009 -0800
@@ -100,6 +100,13 @@
*
*
*
If there is a security manager, this method first
- * calls the security manager's checkCreateClassLoader
method
+ * calls the security manager's {@code checkCreateClassLoader} method
* to ensure creation of a class loader is allowed.
*
* @param urls the URLs from which to load classes and resources
* @param parent the parent class loader for delegation
* @exception SecurityException if a security manager exists and its
- * checkCreateClassLoader
method doesn't allow
+ * {@code checkCreateClassLoader} method doesn't allow
* creation of a class loader.
* @see SecurityManager#checkCreateClassLoader
*/
@@ -169,12 +171,65 @@
acc = AccessController.getContext();
}
+
+ /**
+ * Closes this URLClassLoader, so that it can no longer be used to load
+ * new classes or resources that are defined by this loader.
+ * Classes and resources defined by any of this loader's parents in the
+ * delegation hierarchy are still accessible. Also, any classes or resources
+ * that are already loaded, are still accessible.
+ *
+ * In the case of jar: and file: URLs, it also closes any class files, + * or JAR files that were opened by it. If another thread is loading a + * class when the {@code close} method is invoked, then the result of + * that load is undefined. + *
+ * The method makes a best effort attempt to close all opened files, + * by catching {@link IOException}s internally. Unchecked exceptions + * and errors are not caught. Calling close on an already closed + * loader has no effect. + *
+ * @throws IOException if closing any file opened by this class loader
+ * resulted in an IOException. Any such exceptions are caught, and a
+ * single IOException is thrown after the last file has been closed.
+ * If only one exception was thrown, it will be set as the cause
+ * of this IOException.
+ *
+ * @throws SecurityException if a security manager is set, and it denies
+ * {@link RuntimePermission}("closeClassLoader")
+ *
+ * @since 1.7
+ */
+ public void close() throws IOException {
+ SecurityManager security = System.getSecurityManager();
+ if (security != null) {
+ security.checkPermission(new RuntimePermission("closeClassLoader"));
+ }
+ List
* If the URL specified is Formatted printing for the Java language is heavily inspired by C's
- * printf. Although the format strings are similar to C, some
+ * {@code printf}. Although the format strings are similar to C, some
* customizations have been made to accommodate the Java language and exploit
* some of its features. Also, Java formatting is more strict than C's; for
* example, if a conversion is incompatible with a flag, an exception will be
@@ -115,7 +115,7 @@
* // -> "Unable to open file 'food': No such file or directory"
*
*
- * Like C's sprintf(3), Strings may be formatted using the static
+ * Like C's {@code sprintf(3)}, Strings may be formatted using the static
* method {@link String#format(String,Object...) String.format}:
*
* The optional argument_index is a decimal integer indicating the
* position of the argument in the argument list. The first argument is
- * referenced by "1$", the second by "2$", etc.
+ * referenced by "{@code 1$}", the second by "{@code 2$}", etc.
*
* The optional flags is a set of characters that modify the output
* format. The set of valid flags depends on the conversion.
@@ -206,10 +206,10 @@
* defined as above.
*
* The required conversion is a two character sequence. The first
- * character is 't' or 'T'. The second character indicates
+ * character is {@code 't'} or {@code 'T'}. The second character indicates
* the format to be used. These characters are similar to but not completely
- * identical to those defined by GNU date and POSIX
- * strftime(3c).
+ * identical to those defined by GNU {@code date} and POSIX
+ * {@code strftime(3c)}.
*
* The following table summarizes the supported conversions. Conversions
- * denoted by an upper-case character (i.e. 'B', 'H',
- * 'S', 'C', 'X', 'E', 'G',
- * 'A', and 'T') are the same as those for the corresponding
+ * denoted by an upper-case character (i.e. {@code 'B'}, {@code 'H'},
+ * {@code 'S'}, {@code 'C'}, {@code 'X'}, {@code 'E'}, {@code 'G'},
+ * {@code 'A'}, and {@code 'T'}) are the same as those for the corresponding
* lower-case conversion characters except that the result is converted to
* upper case according to the rules of the prevailing {@link java.util.Locale
* Locale}. The result is equivalent to the following invocation of {@link
@@ -284,72 +284,72 @@
* The following date and time conversion suffix characters are defined for
- * the 't' and 'T' conversions. The types are similar to but
- * not completely identical to those defined by GNU date and POSIX
- * strftime(3c). Additional conversion types are provided to access
- * Java-specific functionality (e.g. 'L' for milliseconds within the
+ * the {@code 't'} and {@code 'T'} conversions. The types are similar to but
+ * not completely identical to those defined by GNU {@code date} and POSIX
+ * {@code strftime(3c)}. Additional conversion types are provided to access
+ * Java-specific functionality (e.g. {@code 'L'} for milliseconds within the
* second).
*
* The following conversion characters are used for formatting times:
*
* 1 Depends on the definition of {@link Formattable}.
*
- * 2 For 'd' conversion only.
- *
- * 3 For 'o', 'x', and 'X'
+ * 2 For {@code 'd'} conversion only.
+ *
+ * 3 For {@code 'o'}, {@code 'x'}, and {@code 'X'}
* conversions only.
*
- * 4 For 'd', 'o', 'x', and
- * 'X' conversions applied to {@link java.math.BigInteger BigInteger}
- * or 'd' applied to byte, {@link Byte}, short, {@link
- * Short}, int and {@link Integer}, long, and {@link Long}.
- *
- * 5 For 'e', 'E', 'f',
- * 'g', and 'G' conversions only.
+ * 4 For {@code 'd'}, {@code 'o'}, {@code 'x'}, and
+ * {@code 'X'} conversions applied to {@link java.math.BigInteger BigInteger}
+ * or {@code 'd'} applied to {@code byte}, {@link Byte}, {@code short}, {@link
+ * Short}, {@code int} and {@link Integer}, {@code long}, and {@link Long}.
+ *
+ * 5 For {@code 'e'}, {@code 'E'}, {@code 'f'},
+ * {@code 'g'}, and {@code 'G'} conversions only.
*
* Any characters not explicitly defined as flags are illegal and are
* reserved for future extensions.
@@ -618,11 +618,11 @@
* For general argument types, the precision is the maximum number of
* characters to be written to the output.
*
- * For the floating-point conversions 'e', 'E', and
- * 'f' the precision is the number of digits after the decimal
- * separator. If the conversion is 'g' or 'G', then the
+ * For the floating-point conversions {@code 'e'}, {@code 'E'}, and
+ * {@code 'f'} the precision is the number of digits after the decimal
+ * separator. If the conversion is {@code 'g'} or {@code 'G'}, then the
* precision is the total number of digits in the resulting magnitude after
- * rounding. If the conversion is 'a' or 'A', then the
+ * rounding. If the conversion is {@code 'a'} or {@code 'A'}, then the
* precision must not be specified.
*
* For character, integral, and date/time argument types and the percent
@@ -633,10 +633,10 @@
*
* The argument index is a decimal integer indicating the position of the
* argument in the argument list. The first argument is referenced by
- * "1$", the second by "2$", etc.
+ * "{@code 1$}", the second by "{@code 2$}", etc.
*
* Another way to reference arguments by position is to use the
- * '<' ('\u003c') flag, which causes the argument for
+ * {@code '<'} ('\u003c') flag, which causes the argument for
* the previous format specifier to be re-used. For example, the following two
* statements would produce identical strings:
*
@@ -670,14 +670,14 @@
* applicable to the corresponding argument, then an {@link
* IllegalFormatConversionException} will be thrown.
*
- * All specified exceptions may be thrown by any of the format
- * methods of Formatter as well as by any format convenience
+ * All specified exceptions may be thrown by any of the {@code format}
+ * methods of {@code Formatter} as well as by any {@code format} convenience
* methods such as {@link String#format(String,Object...) String.format} and
* {@link java.io.PrintStream#printf(String,Object...) PrintStream.printf}.
*
- * Conversions denoted by an upper-case character (i.e. 'B',
- * 'H', 'S', 'C', 'X', 'E',
- * 'G', 'A', and 'T') are the same as those for the
+ * Conversions denoted by an upper-case character (i.e. {@code 'B'},
+ * {@code 'H'}, {@code 'S'}, {@code 'C'}, {@code 'X'}, {@code 'E'},
+ * {@code 'G'}, {@code 'A'}, and {@code 'T'}) are the same as those for the
* corresponding lower-case conversion characters except that the result is
* converted to upper case according to the rules of the prevailing {@link
* java.util.Locale Locale}. The result is equivalent to the following
@@ -692,56 +692,56 @@
*
* If the argument is null, then the result is
- * "false". If the argument is a boolean or {@link
+ * If the argument is {@code null}, then the result is
+ * "{@code false}". If the argument is a {@code boolean} or {@link
* Boolean}, then the result is the string returned by {@link
* String#valueOf(boolean) String.valueOf()}. Otherwise, the result is
- * "true".
- *
- * If the '#' flag is given, then a {@link
+ * "{@code true}".
+ *
+ * If the {@code '#'} flag is given, then a {@link
* FormatFlagsConversionMismatchException} will be thrown.
*
- * If the argument, arg is null, then the
- * result is "null". Otherwise, the result is obtained
- * by invoking Integer.toHexString(arg.hashCode()).
- *
- * If the '#' flag is given, then a {@link
+ * If the argument, arg is {@code null}, then the
+ * result is "{@code null}". Otherwise, the result is obtained
+ * by invoking {@code Integer.toHexString(arg.hashCode())}.
+ *
+ * If the {@code '#'} flag is given, then a {@link
* FormatFlagsConversionMismatchException} will be thrown.
*
- * If the argument is null, then the result is
- * "null". If the argument implements {@link Formattable}, then
+ * If the argument is {@code null}, then the result is
+ * "{@code null}". If the argument implements {@link Formattable}, then
* its {@link Formattable#formatTo formatTo} method is invoked.
* Otherwise, the result is obtained by invoking the argument's
- * toString() method.
- *
- * If the '#' flag is given and the argument is not a {@link
+ * {@code toString()} method.
+ *
+ * If the {@code '#'} flag is given and the argument is not a {@link
* Formattable} , then a {@link FormatFlagsConversionMismatchException}
* will be thrown.
*
- * null
or is already in the
- * list of URLs, then invoking this method has no effect.
+ * list of URLs, or if this loader is closed, then invoking this
+ * method has no effect.
*
* @param url the URL to be added to the search path of URLs
*/
@@ -199,7 +254,8 @@
*
* @param name the name of the class
* @return the resulting class
- * @exception ClassNotFoundException if the class could not be found
+ * @exception ClassNotFoundException if the class could not be found,
+ * or if the loader is closed.
*/
protected Class> findClass(final String name)
throws ClassNotFoundException
@@ -370,7 +426,7 @@
*
* @param name the name of the resource
* @return a URL
for the resource, or null
- * if the resource could not be found.
+ * if the resource could not be found, or if the loader is closed.
*/
public URL findResource(final String name) {
/*
@@ -393,6 +449,7 @@
* @param name the resource name
* @exception IOException if an I/O exception occurs
* @return an Enumeration
of URL
s
+ * If the loader is closed, the Enumeration will be empty.
*/
public Enumeration
*
- * This format string is the first argument to the format method. It
- * contains three format specifiers "%1$tm", "%1$te", and
- * "%1$tY" which indicate how the arguments should be processed and
+ * This format string is the first argument to the {@code format} method. It
+ * contains three format specifiers "{@code %1$tm}", "{@code %1$te}", and
+ * "{@code %1$tY}" which indicate how the arguments should be processed and
* where they should be inserted in the text. The remaining portions of the
- * format string are fixed text including "Dukes Birthday: " and any
+ * format string are fixed text including {@code "Dukes Birthday: "} and any
* other spaces or punctuation.
*
* The argument list consists of all arguments passed to the method after the
* format string. In the above example, the argument list is of size one and
- * consists of the {@link java.util.Calendar Calendar} object c.
+ * consists of the {@link java.util.Calendar Calendar} object {@code c}.
*
*
@@ -157,16 +157,16 @@
* String s = String.format("Duke's Birthday: %1$tm %1$te,%1$tY", c);
*
*
@@ -179,7 +179,7 @@
*
*
*
- *
*
* Argument Category
* Description
*
- * 'b', 'B'
+ * {@code 'b'}, {@code 'B'}
* general
- * If the argument arg is null, then the result is
- * "false". If arg is a boolean or {@link
+ * If the argument arg is {@code null}, then the result is
+ * "{@code false}". If arg is a {@code boolean} or {@link
* Boolean}, then the result is the string returned by {@link
* String#valueOf(boolean) String.valueOf(arg)}. Otherwise, the result is
* "true".
*
- * 'h', 'H'
+ * {@code 'h'}, {@code 'H'}
* general
- * If the argument arg is null, then the result is
- * "null". Otherwise, the result is obtained by invoking
- * Integer.toHexString(arg.hashCode()).
- *
- * 's', 'S'
+ * If the argument arg is {@code null}, then the result is
+ * "{@code null}". Otherwise, the result is obtained by invoking
+ * {@code Integer.toHexString(arg.hashCode())}.
+ *
+ * {@code 's'}, {@code 'S'}
* general
- * If the argument arg is null, then the result is
- * "null". If arg implements {@link Formattable}, then
+ * If the argument arg is {@code null}, then the result is
+ * "{@code null}". If arg implements {@link Formattable}, then
* {@link Formattable#formatTo arg.formatTo} is invoked. Otherwise, the
- * result is obtained by invoking arg.toString().
- *
- * 'c', 'C'
+ * result is obtained by invoking {@code arg.toString()}.
+ *
+ * {@code 'c'}, {@code 'C'}
* character
* The result is a Unicode character
*
- * 'd'
+ * {@code 'd'}
* integral
* The result is formatted as a decimal integer
*
- * 'o'
+ * {@code 'o'}
* integral
* The result is formatted as an octal integer
*
- * 'x', 'X'
+ * {@code 'x'}, {@code 'X'}
* integral
* The result is formatted as a hexadecimal integer
*
- * 'e', 'E'
+ * {@code 'e'}, {@code 'E'}
* floating point
* The result is formatted as a decimal number in computerized
* scientific notation
*
- * 'f'
+ * {@code 'f'}
* floating point
* The result is formatted as a decimal number
*
- * 'g', 'G'
+ * {@code 'g'}, {@code 'G'}
* floating point
* The result is formatted using computerized scientific notation or
* decimal format, depending on the precision and the value after rounding.
*
- * 'a', 'A'
+ * {@code 'a'}, {@code 'A'}
* floating point
* The result is formatted as a hexadecimal floating-point number with
* a significand and an exponent
*
- * 't', 'T'
+ * {@code 't'}, {@code 'T'}
* date/time
* Prefix for date and time conversion characters. See Date/Time Conversions.
*
- * '%'
+ * {@code '%'}
* percent
- * The result is a literal '%' ('\u0025')
- *
- * 'n'
+ * The result is a literal {@code '%'} ('\u0025')
+ *
+ * {@code 'n'}
* line separator
* The result is the platform-specific line separator
*
@@ -361,78 +361,78 @@
* Date/Time Conversions
*
*
*
- *
*
@@ -440,55 +440,55 @@
*
* 'H'
+ * {@code 'H'}
* Hour of the day for the 24-hour clock, formatted as two digits with
- * a leading zero as necessary i.e. 00 - 23.
- *
- * 'I'
+ * a leading zero as necessary i.e. {@code 00 - 23}.
+ *
+ * {@code 'I'}
* Hour for the 12-hour clock, formatted as two digits with a leading
- * zero as necessary, i.e. 01 - 12.
- *
- * 'k'
- * Hour of the day for the 24-hour clock, i.e. 0 - 23.
- *
- * 'l'
- * Hour for the 12-hour clock, i.e. 1 - 12.
- *
- * 'M'
+ * zero as necessary, i.e. {@code 01 - 12}.
+ *
+ * {@code 'k'}
+ * Hour of the day for the 24-hour clock, i.e. {@code 0 - 23}.
+ *
+ * {@code 'l'}
+ * Hour for the 12-hour clock, i.e. {@code 1 - 12}.
+ *
+ * {@code 'M'}
* Minute within the hour formatted as two digits with a leading zero
- * as necessary, i.e. 00 - 59.
- *
- * 'S'
+ * as necessary, i.e. {@code 00 - 59}.
+ *
+ * {@code 'S'}
* Seconds within the minute, formatted as two digits with a leading
- * zero as necessary, i.e. 00 - 60 ("60" is a special
+ * zero as necessary, i.e. {@code 00 - 60} ("{@code 60}" is a special
* value required to support leap seconds).
*
- * 'L'
+ * {@code 'L'}
* Millisecond within the second formatted as three digits with
- * leading zeros as necessary, i.e. 000 - 999.
- *
- * 'N'
+ * leading zeros as necessary, i.e. {@code 000 - 999}.
+ *
+ * {@code 'N'}
* Nanosecond within the second, formatted as nine digits with leading
- * zeros as necessary, i.e. 000000000 - 999999999.
- *
- * 'p'
+ * zeros as necessary, i.e. {@code 000000000 - 999999999}.
+ *
+ * {@code 'p'}
* Locale-specific {@linkplain
* java.text.DateFormatSymbols#getAmPmStrings morning or afternoon} marker
- * in lower case, e.g."am" or "pm". Use of the conversion
- * prefix 'T' forces this output to upper case.
- *
- * 'z'
+ * in lower case, e.g."{@code am}" or "{@code pm}". Use of the conversion
+ * prefix {@code 'T'} forces this output to upper case.
+ *
+ * {@code 'z'}
* RFC 822
- * style numeric time zone offset from GMT, e.g. -0800. This
+ * style numeric time zone offset from GMT, e.g. {@code -0800}. This
* value will be adjusted as necessary for Daylight Saving Time. For
- * long, {@link Long}, and {@link Date} the time zone used is
- * the {@plainlink TimeZone#getDefault() default time zone} for this
+ * {@code long}, {@link Long}, and {@link Date} the time zone used is
+ * the {@linkplain TimeZone#getDefault() default time zone} for this
* instance of the Java virtual machine.
*
- * 'Z'
+ * {@code 'Z'}
* A string representing the abbreviation for the time zone. This
* value will be adjusted as necessary for Daylight Saving Time. For
- * long, {@link Long}, and {@link Date} the time zone used is
- * the {@plainlink TimeZone#getDefault() default time zone} for this
+ * {@code long}, {@link Long}, and {@link Date} the time zone used is
+ * the {@linkplain TimeZone#getDefault() default time zone} for this
* instance of the Java virtual machine. The Formatter's locale will
* supersede the locale of the argument (if any).
*
- * 's'
+ * {@code 's'}
* Seconds since the beginning of the epoch starting at 1 January 1970
- * 00:00:00 UTC, i.e. Long.MIN_VALUE/1000 to
- * Long.MAX_VALUE/1000.
- *
- * 'Q'
+ * {@code 00:00:00} UTC, i.e. {@code Long.MIN_VALUE/1000} to
+ * {@code Long.MAX_VALUE/1000}.
+ *
+ * {@code 'Q'}
* Milliseconds since the beginning of the epoch starting at 1 January
- * 1970 00:00:00 UTC, i.e. Long.MIN_VALUE to
- * Long.MAX_VALUE.
+ * 1970 {@code 00:00:00} UTC, i.e. {@code Long.MIN_VALUE} to
+ * {@code Long.MAX_VALUE}.
*
*
*
- *
*
@@ -497,27 +497,27 @@
*
* 'B'
+ * {@code 'B'}
* Locale-specific {@linkplain java.text.DateFormatSymbols#getMonths
- * full month name}, e.g. "January", "February".
- *
- * 'b'
+ * full month name}, e.g. {@code "January"}, {@code "February"}.
+ *
+ * {@code 'b'}
* Locale-specific {@linkplain
* java.text.DateFormatSymbols#getShortMonths abbreviated month name},
- * e.g. "Jan", "Feb".
- *
- * 'h'
- * Same as 'b'.
- *
- * 'A'
+ * e.g. {@code "Jan"}, {@code "Feb"}.
+ *
+ * {@code 'h'}
+ * Same as {@code 'b'}.
+ *
+ * {@code 'A'}
* Locale-specific full name of the {@linkplain
* java.text.DateFormatSymbols#getWeekdays day of the week},
- * e.g. "Sunday", "Monday"
- *
- * 'a'
+ * e.g. {@code "Sunday"}, {@code "Monday"}
+ *
+ * {@code 'a'}
* Locale-specific short name of the {@linkplain
* java.text.DateFormatSymbols#getShortWeekdays day of the week},
- * e.g. "Sun", "Mon"
- *
- * 'C'
- * Four-digit year divided by 100, formatted as two digits
- * with leading zero as necessary, i.e. 00 - 99
- *
- * 'Y'
+ * e.g. {@code "Sun"}, {@code "Mon"}
+ *
+ * {@code 'C'}
+ * Four-digit year divided by {@code 100}, formatted as two digits
+ * with leading zero as necessary, i.e. {@code 00 - 99}
+ *
+ * {@code 'Y'}
* Year, formatted as at least four digits with leading zeros as
- * necessary, e.g. 0092 equals 92 CE for the Gregorian
+ * necessary, e.g. {@code 0092} equals {@code 92} CE for the Gregorian
* calendar.
*
- * 'y'
+ * {@code 'y'}
* Last two digits of the year, formatted with leading zeros as
- * necessary, i.e. 00 - 99.
- *
- * 'j'
+ * necessary, i.e. {@code 00 - 99}.
+ *
+ * {@code 'j'}
* Day of year, formatted as three digits with leading zeros as
- * necessary, e.g. 001 - 366 for the Gregorian calendar.
- *
- * 'm'
+ * necessary, e.g. {@code 001 - 366} for the Gregorian calendar.
+ *
+ * {@code 'm'}
* Month, formatted as two digits with leading zeros as necessary,
- * i.e. 01 - 13.
- *
- * 'd'
+ * i.e. {@code 01 - 13}.
+ *
+ * {@code 'd'}
* Day of month, formatted as two digits with leading zeros as
- * necessary, i.e. 01 - 31
- *
- * 'e'
- * Day of month, formatted as two digits, i.e. 1 - 31.
+ * necessary, i.e. {@code 01 - 31}
+ *
+ * {@code 'e'}
+ * Day of month, formatted as two digits, i.e. {@code 1 - 31}.
*
*
*
- *
*
@@ -591,18 +591,18 @@
*
* 'R'
- * Time formatted for the 24-hour clock as "%tH:%tM"
- *
- * 'T'
- * Time formatted for the 24-hour clock as "%tH:%tM:%tS".
- *
- * 'r'
- * Time formatted for the 12-hour clock as "%tI:%tM:%tS %Tp".
- * The location of the morning or afternoon marker ('%Tp') may be
+ * {@code 'R'}
+ * Time formatted for the 24-hour clock as {@code "%tH:%tM"}
+ *
+ * {@code 'T'}
+ * Time formatted for the 24-hour clock as {@code "%tH:%tM:%tS"}.
+ *
+ * {@code 'r'}
+ * Time formatted for the 12-hour clock as {@code "%tI:%tM:%tS %Tp"}.
+ * The location of the morning or afternoon marker ({@code '%Tp'}) may be
* locale-dependent.
*
- * 'D'
- * Date formatted as "%tm/%td/%ty".
- *
- * 'F'
+ * {@code 'D'}
+ * Date formatted as {@code "%tm/%td/%ty"}.
+ *
+ * {@code 'F'}
* ISO 8601
- * complete date formatted as "%tY-%tm-%td".
- *
- * 'c'
- * Date and time formatted as "%ta %tb %td %tT %tZ %tY",
- * e.g. "Sun Jul 20 16:17:00 EDT 1969".
+ * complete date formatted as {@code "%tY-%tm-%td"}.
+ *
+ * {@code 'c'}
+ * Date and time formatted as {@code "%ta %tb %td %tT %tZ %tY"},
+ * e.g. {@code "Sun Jul 20 16:17:00 EDT 1969"}.
*
*
*
- *
*
@@ -749,7 +749,7 @@
*
* 'b'
+ * {@code 'b'}
* '\u0062'
- * Produces either "true" or "false" as returned by
+ * Produces either "{@code true}" or "{@code false}" as returned by
* {@link Boolean#toString(boolean)}.
*
- * 'B'
+ * {@code 'B'}
* '\u0042'
- * The upper-case variant of 'b'.
- *
- * 'h'
+ * The upper-case variant of {@code 'b'}.
+ *
+ * {@code 'h'}
* '\u0068'
* Produces a string representing the hash code value of the object.
*
- * 'H'
+ * {@code 'H'}
* '\u0048'
- * The upper-case variant of 'h'.
- *
- * 's'
+ * The upper-case variant of {@code 'h'}.
+ *
+ * {@code 's'}
* '\u0073'
* Produces a string.
*
- * 'S'
+ * {@code 'S'}
* '\u0053'
- * The upper-case variant of 's'.
+ * The upper-case variant of {@code 's'}.
*
*