harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qi...@apache.org
Subject svn commit: r768698 [6/18] - in /harmony/enhanced/classlib/branches/java6: ./ modules/annotation/src/main/java/java/lang/annotation/ modules/archive/src/main/java/java/util/jar/ modules/archive/src/main/java/java/util/zip/ modules/auth/src/main/java/co...
Date Sun, 26 Apr 2009 12:30:06 GMT
Modified: harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DESKeySpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DESKeySpec.java?rev=768698&r1=768697&r2=768698&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DESKeySpec.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DESKeySpec.java Sun Apr 26 12:30:01 2009
@@ -23,12 +23,12 @@
 import org.apache.harmony.crypto.internal.nls.Messages;
 
 /**
- * @com.intel.drl.spec_ref
+ * The key specification for a DES key.
  */
 public class DESKeySpec implements KeySpec {
 
     /**
-     * @com.intel.drl.spec_ref
+     * The length of a DES key in bytes.
      */
     public static final int DES_KEY_LEN = 8;
 
@@ -92,14 +92,29 @@
                 };
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>DESKeySpec</code> from the first 8 bytes of the
+     * specified key data.
+     *
+     * @param key
+     *            the key data.
+     * @throws InvalidKeyException
+     *             if the length of the specified key data is less than 8.
      */
     public DESKeySpec(byte[] key) throws InvalidKeyException {
         this(key, 0);
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>DESKeySpec</code> from the first 8 bytes of the
+     * specified key data starting at <code>offset</code>.
+     *
+     * @param key
+     *            the key data
+     * @param offset
+     *            the offset to start at.
+     * @throws InvalidKeyException
+     *             if the length of the specified key data starting at offset is
+     *             less than 8.
      */
     public DESKeySpec(byte[] key, int offset)
                 throws InvalidKeyException {
@@ -115,7 +130,9 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns a copy of the key.
+     *
+     * @return a copy of the key.
      */
     public byte[] getKey() {
         byte[] result = new byte[DES_KEY_LEN];
@@ -124,7 +141,18 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns whether the specified key data starting at <code>offset</code> is
+     * <i>parity-adjusted</i>.
+     *
+     * @param key
+     *            the key data.
+     * @param offset
+     *            the offset to start checking at.
+     * @return {@code true} if the specified key data is parity-adjusted,
+     *            {@code false} otherwise.
+     * @throws InvalidKeyException
+     *             if the length of the key data starting at offset is less than
+     *             8, or the key is null.
      */
     public static boolean isParityAdjusted(byte[] key, int offset)
             throws InvalidKeyException {
@@ -153,7 +181,17 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns whether the specified key data starting at <code>offset</code> is
+     * weak or semi-weak.
+     *
+     * @param key
+     *            the key data.
+     * @param offset
+     *            the offset to start checking at.
+     * @return {@code true} if the specified key data is weak or semi-weak.
+     * @throws InvalidKeyException
+     *             if the length of the key data starting at offset is less than
+     *             8, or it is null.
      */
     public static boolean isWeak(byte[] key, int offset)
               throws InvalidKeyException {

Modified: harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DESedeKeySpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DESedeKeySpec.java?rev=768698&r1=768697&r2=768698&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DESedeKeySpec.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DESedeKeySpec.java Sun Apr 26 12:30:01 2009
@@ -27,19 +27,27 @@
 import org.apache.harmony.crypto.internal.nls.Messages;
 
 /**
- * @com.intel.drl.spec_ref
+ * The key specification for a triple-DES (DES-EDE) key.
  */
 public class DESedeKeySpec implements KeySpec {
 
     /**
-     * @com.intel.drl.spec_ref
+     * The length of a DES-EDE key in bytes.
      */
     public static final int DES_EDE_KEY_LEN = 24;
 
     private final byte[] key;
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>DESedeKeySpec</code> instance from the first 24 (
+     * {@link #DES_EDE_KEY_LEN}) bytes of the specified key data.
+     *
+     * @param key
+     *            the key data.
+     * @throws InvalidKeyException
+     *             if the length of the key data is less than 24.
+     * @throws NullPointerException
+     *             if the key data is null.
      */
     public DESedeKeySpec(byte[] key)
                 throws InvalidKeyException {
@@ -55,7 +63,19 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>DESedeKeySpec</code> instance from the first 24 (
+     * {@link #DES_EDE_KEY_LEN} ) bytes of the specified key data starting at
+     * <code>offset</code>.
+     *
+     * @param key
+     *            the key data
+     * @param offset
+     *            the offset to start at.
+     * @throws InvalidKeyException
+     *             if the length of the key data starting at offset is less than
+     *             24.
+     * @throws NullPointerException
+     *             if the key data is null.
      */
     public DESedeKeySpec(byte[] key, int offset)
                 throws InvalidKeyException {
@@ -71,7 +91,9 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns a copy of the key.
+     *
+     * @return a copy of the key.
      */
     public byte[] getKey() {
         byte[] result = new byte [DES_EDE_KEY_LEN];
@@ -80,7 +102,18 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns whether the specified key data starting at <code>offset</code> is
+     * <i>parity-adjusted</i>.
+     *
+     * @param key
+     *            the key data.
+     * @param offset
+     *            the offset to start checking at.
+     * @return {@code true} if the specified key data is parity-adjusted,
+     *            {@code false} otherwise.
+     * @throws InvalidKeyException
+     *             if the length of the key data starting at offset is less than
+     *             24.
      */
     public static boolean isParityAdjusted(byte[] key, int offset)
                 throws InvalidKeyException {

Modified: harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DHGenParameterSpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DHGenParameterSpec.java?rev=768698&r1=768697&r2=768698&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DHGenParameterSpec.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DHGenParameterSpec.java Sun Apr 26 12:30:01 2009
@@ -25,7 +25,8 @@
 import java.security.spec.AlgorithmParameterSpec;
 
 /**
- * @com.intel.drl.spec_ref
+ * The algorithm parameter specification for generating Diffie-Hellman
+ * parameters used in Diffie-Hellman key agreement.
  */
 public class DHGenParameterSpec implements AlgorithmParameterSpec {
 
@@ -33,7 +34,13 @@
     private final int exponentSize;
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>DHGenParameterSpec</code> instance with the specified
+     * parameters.
+     *
+     * @param primeSize
+     *            the size of the <i>prime modulus</i> in bits.
+     * @param exponentSize
+     *            the size of the <i>random exponent</i> in bits.
      */
     public DHGenParameterSpec(int primeSize, int exponentSize) {
         this.primeSize = primeSize;
@@ -41,14 +48,18 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the size of the <i>prime modulus</i> in bits.
+     *
+     * @return the size of the prime modulus in bits.
      */
     public int getPrimeSize() {
         return primeSize;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the size of the <i>random exponent</i> in bits.
+     *
+     * @return the size of the random exponent in bits.
      */
     public int getExponentSize() {
         return exponentSize;

Modified: harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DHParameterSpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DHParameterSpec.java?rev=768698&r1=768697&r2=768698&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DHParameterSpec.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DHParameterSpec.java Sun Apr 26 12:30:01 2009
@@ -26,7 +26,7 @@
 import java.security.spec.AlgorithmParameterSpec;
 
 /**
- * @com.intel.drl.spec_ref
+ * The algorithm parameter specification for the Diffie-Hellman algorithm.
  */
 public class DHParameterSpec implements AlgorithmParameterSpec {
 
@@ -35,7 +35,13 @@
     private final int l;
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>DHParameterSpec</code> instance with the specified
+     * <i>prime modulus</i> and <i>base generator</i>.
+     *
+     * @param p
+     *            the prime modulus.
+     * @param g
+     *            the base generator.
      */
     public DHParameterSpec(BigInteger p, BigInteger g) {
         this.p = p;
@@ -44,7 +50,16 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>DHParameterSpec</code> instance with the specified
+     * <i>prime modulus</i>, <i>base generator</i> and size (in bits) of the
+     * <i>random exponent</i>.
+     *
+     * @param p
+     *            the prime modulus.
+     * @param g
+     *            the base generator.
+     * @param l
+     *            the size of the random exponent (in bits).
      */
     public DHParameterSpec(BigInteger p, BigInteger g, int l) {
         this.p = p;
@@ -53,21 +68,27 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the <i>prime modulus</i> of this parameter specification.
+     *
+     * @return the prime modulus.
      */
     public BigInteger getP() {
         return p;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the <i>base generator</i> of this parameter specification.
+     *
+     * @return the base generator.
      */
     public BigInteger getG() {
         return g;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the size (in bits) of the <i>random exponent</i>.
+     *
+     * @return the size (in bits) of the random exponent.
      */
     public int getL() {
         return l;

Modified: harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DHPrivateKeySpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DHPrivateKeySpec.java?rev=768698&r1=768697&r2=768698&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DHPrivateKeySpec.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DHPrivateKeySpec.java Sun Apr 26 12:30:01 2009
@@ -26,7 +26,7 @@
 import java.security.spec.KeySpec;
 
 /**
- * @com.intel.drl.spec_ref
+ * The key specification for a Diffie-Hellman private key.
  */
 public class DHPrivateKeySpec implements KeySpec {
 
@@ -35,7 +35,16 @@
     private final BigInteger g;
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>DHPrivateKeySpec</code> with the specified <i>private
+     * value</i> <code>x</code>. <i>prime modulus</i> <code>p</code> and <i>base
+     * generator</i> <code>g</code>.
+     *
+     * @param x
+     *            the private value.
+     * @param p
+     *            the prime modulus.
+     * @param g
+     *            the base generator.
      */
     public DHPrivateKeySpec(BigInteger x, BigInteger p, BigInteger g) {
         this.x = x;
@@ -44,21 +53,27 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the <i>private value</i> <code>x</code>.
+     *
+     * @return the private value <code>x</code>.
      */
     public BigInteger getX() {
         return x;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the <i>prime modulus</i> <code>p</code>.
+     *
+     * @return the prime modulus <code>p</code>.
      */
     public BigInteger getP() {
         return p;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the <i>base generator</i> <code>g</code>.
+     *
+     * @return the base generator <code>g</code>.
      */
     public BigInteger getG() {
         return g;

Modified: harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DHPublicKeySpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DHPublicKeySpec.java?rev=768698&r1=768697&r2=768698&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DHPublicKeySpec.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/DHPublicKeySpec.java Sun Apr 26 12:30:01 2009
@@ -26,7 +26,7 @@
 import java.security.spec.KeySpec;
 
 /**
- * @com.intel.drl.spec_ref
+ * The key specification for a Diffie-Hellman public key.
  */
 public class DHPublicKeySpec implements KeySpec {
 
@@ -35,7 +35,16 @@
     private final BigInteger g;
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>DHPublicKeySpec</code> instance with the specified
+     * <i>public value</i> <code>y</code>, the <i>prime modulus</i>
+     * <code>p</code> and the <i>base generator</i> <code>g</code>.
+     *
+     * @param y
+     *            the public value.
+     * @param p
+     *            the prime modulus.
+     * @param g
+     *            the base generator.
      */
     public DHPublicKeySpec(BigInteger y, BigInteger p, BigInteger g) {
         this.y = y;
@@ -44,21 +53,27 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the <i>public value</i> <code>y</code>.
+     *
+     * @return the public value <code>y</code>.
      */
     public BigInteger getY() {
         return y;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the <i>prime modulus</i> <code>p</code>.
+     *
+     * @return the prime modulus <code>p</code>.
      */
     public BigInteger getP() {
         return p;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the <i>base generator</i> <code>g</code>;
+     *
+     * @return the base generator <code>g</code>;
      */
     public BigInteger getG() {
         return g;

Modified: harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/IvParameterSpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/IvParameterSpec.java?rev=768698&r1=768697&r2=768698&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/IvParameterSpec.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/IvParameterSpec.java Sun Apr 26 12:30:01 2009
@@ -26,14 +26,20 @@
 import org.apache.harmony.crypto.internal.nls.Messages;
 
 /**
- * @com.intel.drl.spec_ref
+ * The algorithm parameter specification for an <i>initialization vector</i>.
  */
 public class IvParameterSpec implements AlgorithmParameterSpec {
 
     private final byte[] iv;
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>IvParameterSpec</code> instance with the bytes from
+     * the specified buffer <i>iv</i> used as <i>initialization vector</i>.
+     *
+     * @param iv
+     *            the buffer used as initialization vector.
+     * @throws NullPointerException
+     *             if the specified buffer is null.
      */
     public IvParameterSpec(byte[] iv) {
         if (iv == null) {
@@ -44,7 +50,22 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>IvParameterSpec</code> instance with <code>len</code>
+     * bytes from the specified buffer <code>iv</code> starting at
+     * <code>offset</code>.
+     *
+     * @param iv
+     *            the buffer used as initialization vector.
+     * @param offset
+     *            the offset to start in the buffer.
+     * @param len
+     *            the length of the data.
+     * @throws IllegalArgumentException
+     *             if the specified buffer is null or <code>offset</code> and
+     *             <code>len</code> do not specify a valid chunk in the
+     *             specified buffer.
+     * @throws ArrayIndexOutOfBoundsException
+     *             if <code>offset</code> or <code>len</code> are negative.
      */
     public IvParameterSpec(byte[] iv, int offset, int len) {
         if ((iv == null) || (iv.length - offset < len)) {
@@ -59,7 +80,9 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns a copy of the <i>initialization vector</i> data.
+     *
+     * @return a copy of the initialization vector data.
      */
     public byte[] getIV() {
         byte[] res = new byte[iv.length];

Modified: harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/OAEPParameterSpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/OAEPParameterSpec.java?rev=768698&r1=768697&r2=768698&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/OAEPParameterSpec.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/OAEPParameterSpec.java Sun Apr 26 12:30:01 2009
@@ -27,7 +27,10 @@
 import javax.crypto.spec.PSource;
 
 /**
- * @com.intel.drl.spec_ref
+ * The algorithm parameter specification for the <i>OAEP Padding</i> algorithm.
+ * <p>
+ * This padding algorithm is defined in the <a
+ * href="http://www.ietf.org/rfc/rfc3447.txt">PKCS #1</a> standard.
  */
 public class OAEPParameterSpec implements AlgorithmParameterSpec {
 
@@ -37,7 +40,14 @@
     private final PSource pSrc;
 
     /**
-     * @com.intel.drl.spec_ref
+     * The algorithm parameter instance with default values.
+     * <p>
+     * It uses the following parameters:
+     * <ul><li>message digest : <code>"SHA-1"</code></li>
+     * <li>mask generation function (<i>mgf</i>) : <code>"MGF1"</code></li>
+     * <li>parameters for the <i>mgf</i> : "SHA-1" {@link MGF1ParameterSpec#SHA1}</li>
+     * <li>the source of the label <code>L</code>: {@link PSource.PSpecified#DEFAULT}</li>
+     * </ul>
      */
     public static final OAEPParameterSpec DEFAULT = new OAEPParameterSpec();
 
@@ -49,7 +59,23 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>OAEPParameterSpec</code> instance with the specified
+     * <i>message digest</i> algorithm name, <i>mask generation function</i>
+     * (<i>mgf</i>) algorithm name, <i>parameters</i> for the <i>mgf</i>
+     * algorithm and the <i>source of the label <code>L</code></i>.
+     *
+     * @param mdName
+     *            the message digest algorithm name.
+     * @param mgfName
+     *            the mask generation function algorithm name.
+     * @param mgfSpec
+     *            the algorithm parameter specification for the mask generation
+     *            function algorithm.
+     * @param pSrc
+     *            the source of the label <code>L</code>.
+     * @throws NullPointerException
+     *             if one of <code>mdName</code>, <code>mgfName</code> or
+     *             <code>pSrc</code> is null.
      */
     public OAEPParameterSpec(String mdName, String mgfName,
                                 AlgorithmParameterSpec mgfSpec, PSource pSrc) {
@@ -63,28 +89,38 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the algorithm name of the <i>message digest</i>.
+     *
+     * @return the algorithm name of the message digest.
      */
     public String getDigestAlgorithm() {
         return mdName;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the algorithm name of the <i>mask generation function</i>.
+     *
+     * @return the algorithm name of the mask generation function.
      */
     public String getMGFAlgorithm() {
         return mgfName;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the algorithm parameter specification for the mask generation
+     * function algorithm.
+     *
+     * @return the algorithm parameter specification for the mask generation
+     *         function algorithm.
      */
     public AlgorithmParameterSpec getMGFParameters() {
         return mgfSpec;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the source of the label <code>L</code>.
+     *
+     * @return the source of the label <code>L</code>.
      */
     public PSource getPSource() {
         return pSrc;

Modified: harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/PBEKeySpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/PBEKeySpec.java?rev=768698&r1=768697&r2=768698&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/PBEKeySpec.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/PBEKeySpec.java Sun Apr 26 12:30:01 2009
@@ -28,7 +28,10 @@
 import org.apache.harmony.crypto.internal.nls.Messages;
 
 /**
- * @com.intel.drl.spec_ref
+ * The key specification for a <i>password based encryption</i> key.
+ * <p>
+ * Password based encryption is described in <a
+ * href="http://www.ietf.org/rfc/rfc2898.txt">PKCS #5</a>.
  */
 public class PBEKeySpec implements KeySpec {
 
@@ -38,7 +41,10 @@
     private final int keyLength;
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>PBEKeySpec</code> with the specified password.
+     *
+     * @param password
+     *            the password.
      */
     public PBEKeySpec(char[] password) {
         if (password == null) {
@@ -53,7 +59,22 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>PBEKeySpec</code> with the specified password, salt,
+     * iteration count and the desired length of the derived key.
+     *
+     * @param password
+     *            the password.
+     * @param salt
+     *            the salt.
+     * @param iterationCount
+     *            the iteration count.
+     * @param keyLength
+     *            the desired key length of the derived key,
+     * @throws NullPointerException
+     *             if the salt is null.
+     * @throws IllegalArgumentException
+     *             if the salt is empty, iteration count is zero or negative or
+     *             the key length is zero or negative.
      */
     public PBEKeySpec(char[] password, byte[] salt, int iterationCount,
                       int keyLength) {
@@ -84,7 +105,19 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>PBEKeySpec</code> with the specified password, salt
+     * and iteration count.
+     *
+     * @param password
+     *            the password.
+     * @param salt
+     *            the salt.
+     * @param iterationCount
+     *            the iteration count.
+     * @throws NullPointerException
+     *             if salt is null.
+     * @throws IllegalArgumentException
+     *             if the salt is empty or iteration count is zero or negative.
      */
     public PBEKeySpec(char[] password, byte[] salt, int iterationCount) {
         if (salt == null) {
@@ -111,7 +144,7 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Clears the password by overwriting it.
      */
     public final void clearPassword() {
         Arrays.fill(password, '?');
@@ -119,7 +152,11 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns a copy of the password of this key specification.
+     *
+     * @return a copy of the password of this key specification.
+     * @throws IllegalStateException
+     *             if the password has been cleared before.
      */
     public final char[] getPassword() {
         if (password == null) {
@@ -131,7 +168,10 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns a copy of the salt of this key specification.
+     *
+     * @return a copy of the salt of this key specification or null if none is
+     *         specified.
      */
     public final byte[] getSalt() {
         if (salt == null) {
@@ -143,14 +183,18 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the iteration count of this key specification.
+     *
+     * @return the iteration count of this key specification.
      */
     public final int getIterationCount() {
         return iterationCount;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the desired key length of the derived key.
+     *
+     * @return the desired key length of the derived key.
      */
     public final int getKeyLength() {
         return keyLength;

Modified: harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/PBEParameterSpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/PBEParameterSpec.java?rev=768698&r1=768697&r2=768698&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/PBEParameterSpec.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/PBEParameterSpec.java Sun Apr 26 12:30:01 2009
@@ -27,7 +27,12 @@
 import org.apache.harmony.crypto.internal.nls.Messages;
 
 /**
- * @com.intel.drl.spec_ref
+ * The algorithm parameter specification for a <i>password based encryption</i>
+ * algorithm.
+ * <p>
+ * Password based encryption is described in <a
+ * href="http://www.ietf.org/rfc/rfc2898.txt">PKCS #5</a>.
+ *
  */
 public class PBEParameterSpec implements AlgorithmParameterSpec {
 
@@ -35,7 +40,15 @@
     private final int iterationCount;
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>PBEParameterSpec</code> with the specified salt and
+     * iteration count.
+     *
+     * @param salt
+     *            the salt.
+     * @param iterationCount
+     *            the iteration count.
+     * @throws NullPointerException
+     *             if salt is null.
      */
     public PBEParameterSpec(byte[] salt, int iterationCount) {
         if (salt == null) {
@@ -47,7 +60,9 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns a copy to the salt.
+     *
+     * @return a copy to the salt.
      */
     public byte[] getSalt() {
         byte[] result = new byte[salt.length];
@@ -56,7 +71,9 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the iteration count.
+     *
+     * @return the iteration count.
      */
     public int getIterationCount() {
         return iterationCount;

Modified: harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/PSource.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/PSource.java?rev=768698&r1=768697&r2=768698&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/PSource.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/PSource.java Sun Apr 26 12:30:01 2009
@@ -25,7 +25,8 @@
 import org.apache.harmony.crypto.internal.nls.Messages;
 
 /**
- * @com.intel.drl.spec_ref
+ * The source of the label <code>L</code> as specified in <a
+ * href="http://www.ietf.org/rfc/rfc3447.txt"> PKCS #1</a>.
  */
 public class PSource {
 
@@ -34,7 +35,13 @@
     private PSource() {}
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>PSource</code> instance with the specified source
+     * algorithm identifier.
+     *
+     * @param pSrcName
+     *            the source algorithm identifier.
+     * @throws NullPointerException
+     *             if pSrcName is null.
      */
     protected PSource(String pSrcName) {
         if (pSrcName == null) {
@@ -44,21 +51,25 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the source algorithm identifier.
+     *
+     * @return the source algorithm identifier.
      */
     public String getAlgorithm() {
         return pSrcName;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * The explicit specification of the parameter <code>P</code> used in the
+     * source algorithm.
      */
     public static final class PSpecified extends PSource {
 
         private final byte[] p;
 
         /**
-         * @com.intel.drl.spec_ref
+         * The instance of <code>PSpecified</code> with the default value
+         * <code>byte[0]</code> for <code>P</code>
          */
         public static final PSpecified DEFAULT = new PSpecified();
 
@@ -68,7 +79,13 @@
         }
 
         /**
-         * @com.intel.drl.spec_ref
+         * Creates a new instance of <code>PSpecified</code> with the specified
+         * parameter <code>P</code>.
+         *
+         * @param p
+         *            the parameter <code>P</code>.
+         * @throws NullPointerException
+         *             if <code>p</code> is null.
          */
         public PSpecified(byte[] p) {
             super("PSpecified"); //$NON-NLS-1$
@@ -82,7 +99,9 @@
         }
 
         /**
-         * @com.intel.drl.spec_ref
+         * Returns a copy of the value of the parameter <code>P</code>.
+         *
+         * @return a copy of the value of the parameter <code>P</code>
          */
         public byte[] getValue() {
             byte[] result = new byte[p.length];

Modified: harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/RC2ParameterSpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/RC2ParameterSpec.java?rev=768698&r1=768697&r2=768698&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/RC2ParameterSpec.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/RC2ParameterSpec.java Sun Apr 26 12:30:01 2009
@@ -28,7 +28,8 @@
 import org.apache.harmony.crypto.internal.nls.Messages;
 
 /**
- * @com.intel.drl.spec_ref
+ * The algorithm parameter specification for the <a
+ * href="http://www.ietf.org/rfc/rfc2268.txt">RC2</a> algorithm.
  */
 public class RC2ParameterSpec implements AlgorithmParameterSpec {
 
@@ -36,7 +37,11 @@
     private final byte[] iv;
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>RC2ParameterSpec</code> instance with the specified
+     * effective key length (in bits),
+     *
+     * @param effectiveKeyBits
+     *            the effective key length (in bits).
      */
     public RC2ParameterSpec(int effectiveKeyBits) {
         this.effectiveKeyBits = effectiveKeyBits;
@@ -44,7 +49,18 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>RC2ParameterSpec</code> instance with the specified
+     * effective key length (in bits) and <i>initialization vector</i>.
+     * <p>
+     * The size of the <i>initialization vector</i> must be at least 8 bytes
+     * which are copied to protect them against modification.
+     *
+     * @param effectiveKeyBits
+     *            the effective key length (in bits).
+     * @param iv
+     *            the initialization vector.
+     * @throws IllegalArgumentException
+     *             if the initialization vector is null or shorter than 8 bytes.
      */
     public RC2ParameterSpec(int effectiveKeyBits, byte[] iv) {
         if (iv == null) {
@@ -59,7 +75,22 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>RC2ParameterSpec</code> instance with the specified
+     * effective key length (in bits) and <i>initialization vector<i>.
+     * <p>
+     * The size of the <i>initialization vector</i> starting at
+     * <code>offset</code> must be at least 8 bytes which are copied to protect
+     * them against modification.
+     *
+     * @param effectiveKeyBits
+     *            the effective key length (in bits).
+     * @param iv
+     *            the initialization vector.
+     * @param offset
+     *            the offset in the initialization vector to start at.
+     * @throws IllegalArgumentException
+     *             if the initialization vector is null or starting at
+     *             <code>offset</code> is shorter than 8 bytes.
      */
     public RC2ParameterSpec(int effectiveKeyBits, byte[] iv, int offset) {
         if (iv == null) {
@@ -74,14 +105,18 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the effective key length (in bits).
+     *
+     * @return the effective key length (in bits).
      */
     public int getEffectiveKeyBits() {
         return effectiveKeyBits;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns a copy of the initialization vector.
+     *
+     * @return a copy of the initialization vector, or null if none specified.
      */
     public byte[] getIV() {
         if (iv == null) {
@@ -93,7 +128,13 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Compares the specified object to this <code>RC2ParameterSpec</code>
+     * instance.
+     *
+     * @param obj
+     *            the object to compare.
+     * @return true if the effective key length and the initialization vector of
+     *         both objects are equal, otherwise false.
      */
     @Override
     public boolean equals(Object obj) {
@@ -109,7 +150,9 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the hash code of this <code>RC2ParameterSpec</code> instance.
+     *
+     * @return the hash code.
      */
     @Override
     public int hashCode() {

Modified: harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/RC5ParameterSpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/RC5ParameterSpec.java?rev=768698&r1=768697&r2=768698&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/RC5ParameterSpec.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/RC5ParameterSpec.java Sun Apr 26 12:30:01 2009
@@ -28,7 +28,8 @@
 import org.apache.harmony.crypto.internal.nls.Messages;
 
 /**
- * @com.intel.drl.spec_ref
+ * The algorithm parameter specification for the <a
+ * href="http://www.ietf.org/rfc/rfc2040.txt">RC5</a> algorithm.
  */
 public class RC5ParameterSpec implements AlgorithmParameterSpec {
 
@@ -38,7 +39,15 @@
     private final byte[] iv;
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>RC5ParameterSpec</code> instance with the specified
+     * version, round count an word size (in bits).
+     *
+     * @param version
+     *            the version.
+     * @param rounds
+     *            the round count.
+     * @param wordSize
+     *            the word size (in bits).
      */
     public RC5ParameterSpec(int version, int rounds, int wordSize) {
         this.version = version;
@@ -48,7 +57,25 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>RC5ParameterSpec</code> instance with the specified
+     * version, round count, word size (in bits) and an <i>initialization
+     * vector</i>.
+     * <p>
+     * The size of the <i>initialization vector</i> must be at least
+     * <code>2 * (wordSize / 8)</code> bytes which are copied to protect them
+     * against modification.
+     *
+     * @param version
+     *            the version.
+     * @param rounds
+     *            the round count.
+     * @param wordSize
+     *            the word size (in bits).
+     * @param iv
+     *            the initialization vector.
+     * @throws IllegalArgumentException
+     *             if the initialization vector is null or shorter than <code>2
+     *             * (wordSize / 8)</code>.
      */
     public RC5ParameterSpec(int version, int rounds, int wordSize, byte[] iv) {
         if (iv == null) {
@@ -66,7 +93,29 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>RC5ParameterSpec</code> instance with the specified
+     * version, round count, wordSize (in bits), an <i>initialization vector</i>
+     * and an offset.
+     * <p>
+     * The size of the <i>initialization vector</i> must be at least
+     * <code>offset + (2 * (wordSize / 8))</code> bytes. The bytes starting at
+     * <code>offset</code> are copied to protect them against modification.
+     *
+     * @param version
+     *            the version.
+     * @param rounds
+     *            the round count.
+     * @param wordSize
+     *            the word size (in bits).
+     * @param iv
+     *            the initialization vector.
+     * @param offset
+     *            the offset in the initialization vector.
+     * @throws IllegalArgumentException
+     *             if the initialization vector is null of shorter than
+     *             <code>offset + (2 * (wordSize / 8))</code>.
+     * @throws ArrayIndexOutOfBoundsException
+     *             if <code>offset</code> is negative.
      */
     public RC5ParameterSpec(int version, int rounds,
                                 int wordSize, byte[] iv, int offset) {
@@ -88,28 +137,36 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the version.
+     *
+     * @return the version.
      */
     public int getVersion() {
         return version;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the round count.
+     *
+     * @return the round count.
      */
     public int getRounds() {
         return rounds;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the word size (in bits).
+     *
+     * @return the word size (in bits).
      */
     public int getWordSize() {
         return wordSize;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns a copy of the initialization vector.
+     *
+     * @return a copy of the initialization vector, or null if none specified.
      */
     public byte[] getIV() {
         if (iv == null) {
@@ -121,7 +178,13 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Compares the specified object with this <code>RC5ParameterSpec</code>
+     * instance.
+     *
+     * @param obj
+     *            the object to compare.
+     * @return true if version, round count, word size and initializaion vector
+     *         of both objects are equal, otherwise false.
      */
     @Override
     public boolean equals(Object obj) {
@@ -139,7 +202,9 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the hash code of this <code>RC5ParameterSpec</code> instance.
+     *
+     * @return the hash code.
      */
     @Override
     public int hashCode() {

Modified: harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/SecretKeySpec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/SecretKeySpec.java?rev=768698&r1=768697&r2=768698&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/SecretKeySpec.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/crypto/src/main/java/javax/crypto/spec/SecretKeySpec.java Sun Apr 26 12:30:01 2009
@@ -30,7 +30,9 @@
 import org.apache.harmony.crypto.internal.nls.Messages;
 
 /**
- * @com.intel.drl.spec_ref
+ * A key specification for a <code>SecretKey</code> and also a secret key
+ * implementation that is provider-independent. It can be used for raw secret
+ * keys that can be specified as <code>byte[]</code>.
  */
 public class SecretKeySpec implements SecretKey, KeySpec, Serializable {
 
@@ -44,15 +46,24 @@
     private final String format = "RAW"; //$NON-NLS-1$
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>SecretKeySpec</code> for the specified key data and
+     * algorithm name.
+     *
+     * @param key
+     *            the key data.
+     * @param algorithm
+     *            the algorithm name.
+     * @throws IllegalArgumentException
+     *             if the key data or the algorithm name is null or if the key
+     *             data is empty.
      */
     public SecretKeySpec(byte[] key, String algorithm) {
-    	if (key == null) {
-    		throw new IllegalArgumentException(Messages.getString("crypto.05")); //$NON-NLS-1$
-    	}
-    	if (key.length == 0) {
-    		throw new IllegalArgumentException(Messages.getString("crypto.35")); //$NON-NLS-1$
-    	}
+        if (key == null) {
+            throw new IllegalArgumentException(Messages.getString("crypto.05")); //$NON-NLS-1$
+        }
+        if (key.length == 0) {
+            throw new IllegalArgumentException(Messages.getString("crypto.35")); //$NON-NLS-1$
+        }
         if (algorithm == null) {
             throw new IllegalArgumentException(Messages.getString("crypto.02")); //$NON-NLS-1$
         }
@@ -63,21 +74,38 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Creates a new <code>SecretKeySpec</code> for the key data from the
+     * specified buffer <code>key</code> starting at <code>offset</code> with
+     * length <code>len</code> and the specified <code>algorithm</code> name.
+     *
+     * @param key
+     *            the key data.
+     * @param offset
+     *            the offset.
+     * @param len
+     *            the size of the key data.
+     * @param algorithm
+     *            the algorithm name.
+     * @throws IllegalArgumentException
+     *             if the key data or the algorithm name is null, the key data
+     *             is empty or <code>offset</code> and <code>len</code> do not
+     *             specify a valid chunk in the buffer <code>key</code>.
+     * @throws ArrayIndexOutOfBoundsException
+     *             if <code>offset</code> or <code>len</code> is negative.
      */
     public SecretKeySpec(byte[] key, int offset, int len, String algorithm) {
-    	if (key == null) {
-    		throw new IllegalArgumentException(Messages.getString("crypto.05")); //$NON-NLS-1$
-    	}
-    	if (key.length == 0) {
-    		throw new IllegalArgumentException(Messages.getString("crypto.35")); //$NON-NLS-1$
-    	}
+        if (key == null) {
+            throw new IllegalArgumentException(Messages.getString("crypto.05")); //$NON-NLS-1$
+        }
+        if (key.length == 0) {
+            throw new IllegalArgumentException(Messages.getString("crypto.35")); //$NON-NLS-1$
+        }
         if (len < 0) {
             throw new ArrayIndexOutOfBoundsException(Messages.getString("crypto.36")); //$NON-NLS-1$
         }
-    	if ((key.length - offset < len)) {
-    		throw new IllegalArgumentException(Messages.getString("crypto.37")); //$NON-NLS-1$
-    	}
+        if ((key.length - offset < len)) {
+            throw new IllegalArgumentException(Messages.getString("crypto.37")); //$NON-NLS-1$
+        }
         if (algorithm == null) {
             throw new IllegalArgumentException(Messages.getString("crypto.02")); //$NON-NLS-1$
         }
@@ -87,21 +115,27 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the algorithm name.
+     *
+     * @return the algorithm name.
      */
     public String getAlgorithm() {
         return algorithm;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the name of the format used to encode the key.
+     *
+     * @return the format name "RAW".
      */
     public String getFormat() {
         return format;
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the encoded form of this secret key.
+     *
+     * @return the encoded form of this secret key.
      */
     public byte[] getEncoded() {
         byte[] result = new byte[key.length];
@@ -110,7 +144,9 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Returns the hash code of this <code>SecretKeySpec</code> object.
+     *
+     * @return the hash code.
      */
     @Override
     public int hashCode() {
@@ -122,7 +158,13 @@
     }
 
     /**
-     * @com.intel.drl.spec_ref
+     * Compares the specified object with this <code>SecretKeySpec</code>
+     * instance.
+     *
+     * @param obj
+     *            the object to compare.
+     * @return true if the algorithm name and key of both object are equal,
+     *         otherwise false.
      */
     @Override
     public boolean equals(Object obj) {

Modified: harmony/enhanced/classlib/branches/java6/modules/lang-management/src/main/java/java/lang/management/MemoryNotificationInfo.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/lang-management/src/main/java/java/lang/management/MemoryNotificationInfo.java?rev=768698&r1=768697&r2=768698&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/lang-management/src/main/java/java/lang/management/MemoryNotificationInfo.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/lang-management/src/main/java/java/lang/management/MemoryNotificationInfo.java Sun Apr 26 12:30:01 2009
@@ -37,11 +37,14 @@
      * </p>
      * 
      * @param cd The CompositeDate object to retrieve data from.
-     * @return A MemoryNotificationInfo instance.
+     * @return A MemoryNotificationInfo instance or {@code null} if {@code cd} is {@code null}
      * @throws IllegalArgumentException if <code>cd</code> does not contain
      *         MemoryUsage data.
      */
     public static MemoryNotificationInfo from(CompositeData cd) {
+        if (cd == null) {
+            return null;
+        }
         String poolName = (String) cd.get("poolName");
         MemoryUsage usage = MemoryUsage.from((CompositeData) cd.get("usage"));
         long count = ((Long) cd.get("count")).longValue();
@@ -62,9 +65,19 @@
      * @param poolName The memory pool name.
      * @param usage The memory usage snapshot.
      * @param count The threshold crossing count.
+     * 
+     * @throws NullPointerException if {@code poolName} or {@code usage} is {@code null}
      */
     public MemoryNotificationInfo(String poolName, MemoryUsage usage, long count) {
         super();
+        if (poolName == null) {
+            throw new NullPointerException("pooName is null"); //$NON-NLS-1$
+        }
+        
+        if (usage == null) {
+            throw new NullPointerException("usage is null"); //$NON-NLS-1$
+        }
+        
         this.poolName = poolName;
         this.usage = usage;
         this.count = count;

Modified: harmony/enhanced/classlib/branches/java6/modules/lang-management/src/main/java/java/lang/management/MemoryUsage.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/lang-management/src/main/java/java/lang/management/MemoryUsage.java?rev=768698&r1=768697&r2=768698&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/lang-management/src/main/java/java/lang/management/MemoryUsage.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/lang-management/src/main/java/java/lang/management/MemoryUsage.java Sun Apr 26 12:30:01 2009
@@ -39,6 +39,9 @@
      *         MemoryUsage data.
      */
     public static MemoryUsage from(CompositeData cd) {
+        if (cd == null) {
+            return null;
+        }
         try {
             long init = ((Long) cd.get("init")).longValue();
             long used = ((Long) cd.get("used")).longValue();

Modified: harmony/enhanced/classlib/branches/java6/modules/lang-management/src/test/api/java/org/apache/harmony/lang/management/tests/java/lang/management/MemoryUsageTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/lang-management/src/test/api/java/org/apache/harmony/lang/management/tests/java/lang/management/MemoryUsageTest.java?rev=768698&r1=768697&r2=768698&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/lang-management/src/test/api/java/org/apache/harmony/lang/management/tests/java/lang/management/MemoryUsageTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/lang-management/src/test/api/java/org/apache/harmony/lang/management/tests/java/lang/management/MemoryUsageTest.java Sun Apr 26 12:30:01 2009
@@ -90,6 +90,10 @@
         }
     }
 
+    public void test_from_NullCompositeData() {
+        assertNull(MemoryUsage.from(null));
+    }
+
     public void testConstructor() {
         try {
             new MemoryUsage(-2, 2048, 4096, 8128);

Modified: harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/ConsoleHandler.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/ConsoleHandler.java?rev=768698&r1=768697&r2=768698&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/ConsoleHandler.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/ConsoleHandler.java Sun Apr 26 12:30:01 2009
@@ -19,42 +19,39 @@
 
 /**
  * A handler that writes log messages to the standard output stream
- * <code>System.err</code>.
+ * {@code System.err}.
  * <p>
  * This handler reads the following properties from the log manager to
  * initialize itself:
  * <ul>
  * <li>java.util.logging.ConsoleHandler.level specifies the logging level,
- * defaults to <code>Level.INFO</code> if this property is not found or has an
- * invalid value;
+ * defaults to {@code Level.INFO} if this property is not found or has an
+ * invalid value.
  * <li>java.util.logging.ConsoleHandler.filter specifies the name of the filter
- * class to be associated with this handler, defaults to <code>null</code> if
- * this property is not found or has an invalid value;
+ * class to be associated with this handler, defaults to {@code null} if this
+ * property is not found or has an invalid value.
  * <li>java.util.logging.ConsoleHandler.formatter specifies the name of the
  * formatter class to be associated with this handler, defaults to
- * <code>java.util.logging.SimpleFormatter</code> if this property is not
- * found or has an invalid value;
+ * {@code java.util.logging.SimpleFormatter} if this property is not found or
+ * has an invalid value.
  * <li>java.util.logging.ConsoleHandler.encoding specifies the encoding this
- * handler will use to encode log messages, defaults to <code>null</code> if
- * this property is not found or has an invalid value.
+ * handler will use to encode log messages, defaults to {@code null} if this
+ * property is not found or has an invalid value.
  * </ul>
- * </p>
  * <p>
  * This class is not thread-safe.
- * </p>
  */
 public class ConsoleHandler extends StreamHandler {
 
     /**
-     * Constructs a <code>ConsoleHandler</code> object.
+     * Constructs a {@code ConsoleHandler} object.
      */
     public ConsoleHandler() {
         super(System.err);
     }
 
     /**
-     * Closes this handler. The <code>System.err</code> is flushed but not
-     * closed.
+     * Closes this handler. The {@code System.err} is flushed but not closed.
      */
     @Override
     public void close() {
@@ -65,7 +62,7 @@
      * Logs a record if necessary. A flush operation will be done.
      * 
      * @param record
-     *            the log record to be logged
+     *            the log record to be logged.
      */
     @Override
     public void publish(LogRecord record) {

Modified: harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/ErrorManager.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/ErrorManager.java?rev=768698&r1=768697&r2=768698&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/ErrorManager.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/ErrorManager.java Sun Apr 26 12:30:01 2009
@@ -21,9 +21,9 @@
 
 /**
  * An error reporting facility for {@link Handler} implementations to record any
- * error that may happen during logging. <code>Handlers</code> should report
- * errors to an <code>ErrorManager</code>, instead of throwing exceptions,
- * which would interfere with the log issuer's execution.
+ * error that may happen during logging. {@code Handlers} should report errors
+ * to an {@code ErrorManager}, instead of throwing exceptions, which would
+ * interfere with the log issuer's execution.
  */
 public class ErrorManager {
 
@@ -70,7 +70,7 @@
     private boolean called;
 
     /**
-     * Constructs an instance of <code>ErrorManager</code>.
+     * Constructs an instance of {@code ErrorManager}.
      */
     public ErrorManager() {
         super();
@@ -83,13 +83,13 @@
      * should override this method.
      * 
      * @param message
-     *            The error message, which may be <code>null</code>.
+     *            the error message, which may be {@code null}.
      * @param exception
-     *            The exception associated with the error, which may be
-     *            <code>null</code>.
+     *            the exception associated with the error, which may be
+     *            {@code null}.
      * @param errorCode
-     *            The error code that identifies the type of error; see the
-     *            constant fields on this class.
+     *            the error code that identifies the type of error; see the
+     *            constant fields of this class for possible values.
      */
     public void error(String message, Exception exception, int errorCode) {
         synchronized (this) {

Modified: harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/FileHandler.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/FileHandler.java?rev=768698&r1=768697&r2=768698&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/FileHandler.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/FileHandler.java Sun Apr 26 12:30:01 2009
@@ -32,75 +32,68 @@
 import org.apache.harmony.logging.internal.nls.Messages;
 
 /**
- * A <code>FileHandler</code> is a Handler that writes logging events to one
- * or more files.
- * 
+ * A {@code FileHandler} writes logging records into a specified file or a
+ * rotating set of files.
  * <p>
- * If multiple files are used, when a given amount of data has been written to
- * one file, this file is closed, and the next file is opened. The names of
- * these files are generated by the given name pattern, see below for details.
- * When all the files have all been filled the Handler returns to the first one
- * and goes through the set again.
- * </p>
- * 
+ * When a set of files is used and a given amount of data has been written to
+ * one file, then this file is closed and another file is opened. The name of
+ * these files are generated by given name pattern, see below for details.
+ * When the files have all been filled the Handler returns to the first and goes
+ * through the set again.
  * <p>
- * <code>FileHandler</code> defines the following configuration properties,
- * which are read by the <code>LogManager</code> on initialization. If the
- * properties have not been specified then defaults will be used. The properties
- * and defaults are as follows:
+ * By default, the I/O buffering mechanism is enabled, but when each log record
+ * is complete, it is flushed out.
+ * <p>
+ * {@code XMLFormatter} is the default formatter for {@code FileHandler}.
+ * <p>
+ * {@code FileHandler} reads the following {@code LogManager} properties for
+ * initialization; if a property is not defined or has an invalid value, a
+ * default value is used.
  * <ul>
- * <li>java.util.logging.FileHandler.append - If true then this
- * <code>FileHandler</code> appends to a file's existing content, if false it
- * overwrites it. Default is false.</li>
- * <li>java.util.logging.FileHandler.count - the number of output files to
- * rotate. Default is 1.</li>
- * <li>java.util.logging.FileHandler.filter - the name of the
- * <code>Filter</code> class. No <code>Filter</code> is used by default.</li>
- * <li>java.util.logging.FileHandler.formatter - the name of the
- * <code>Formatter</code> class. Default is
- * <code>java.util.logging.XMLFormatter</code>.</li>
- * <li>java.util.logging.FileHandler.encoding - the name of the character set
- * encoding. Default is the encoding used by the current platform.</li>
- * <li>java.util.logging.FileHandler.level - the log level for this
- * <code>Handler</code>. Default is <code>Level.ALL</code>.</li>
- * <li>java.util.logging.FileHandler.limit - the limit at which no more bytes
- * should be written to the current file. Default is no limit.</li>
- * <li>java.util.logging.FileHandler.pattern - the pattern for the name of log
- * files. Default is "%h/java%u.log".</li>
+ * <li>java.util.logging.FileHandler.append specifies whether this
+ * {@code FileHandler} should append onto existing files, defaults to
+ * {@code false}.</li>
+ * <li>java.util.logging.FileHandler.count specifies how many output files to
+ * rotate, defaults to 1.</li>
+ * <li>java.util.logging.FileHandler.filter specifies the {@code Filter} class
+ * name, defaults to no {@code Filter}.</li>
+ * <li>java.util.logging.FileHandler.formatter specifies the {@code Formatter}
+ * class, defaults to {@code java.util.logging.XMLFormatter}.</li>
+ * <li>java.util.logging.FileHandler.encoding specifies the character set
+ * encoding name, defaults to the default platform encoding.</li>
+ * <li>java.util.logging.FileHandler.level specifies the level for this
+ * {@code Handler}, defaults to {@code Level.ALL}.</li>
+ * <li>java.util.logging.FileHandler.limit specifies the maximum number of
+ * bytes to write to any one file, defaults to zero, which means no limit.</li>
+ * <li>java.util.logging.FileHandler.pattern specifies name pattern for the
+ * output files. See below for details. Defaults to "%h/java%u.log".</li>
  * </ul>
- * </p>
- * 
  * <p>
- * The name pattern is a String that can contain some of the following
- * sub-strings, which will be replaced to generate the output file names:
+ * Name pattern is a string that may include some special substrings, which will
+ * be replaced to generate output files:
  * <ul>
- * <li>"/" represents the local path separator</li>
- * <li>"%g" represents the generation number used to enumerate log files</li>
+ * <li>"/" represents the local pathname separator</li>
+ * <li>"%g" represents the generation number to distinguish rotated logs</li>
  * <li>"%h" represents the home directory of the current user, which is
- * specified by the "user.home" system property</li>
+ * specified by "user.home" system property</li>
  * <li>"%t" represents the system's temporary directory</li>
- * <li>"%u" represents a unique number added to the file name if the original
- * file required is in use</li>
+ * <li>"%u" represents a unique number to resolve conflicts</li>
  * <li>"%%" represents the percent sign character '%'</li>
  * </ul>
- * </p>
- * 
  * <p>
- * The generation numbers, denoted by "%g" in the filename pattern will be
- * created in ascending numerical order from 0, i.e. 0,1,2,3... If "%g" was not
- * present in the pattern and more than one file is being used then a dot and a
- * generation number is appended to the filename at the end. This is equivalent
- * to appending ".%g" to the pattern.
- * </p>
- * 
+ * Normally, the generation numbers are not larger than the given file count and
+ * follow the sequence 0, 1, 2.... If the file count is larger than one, but the
+ * generation field("%g") has not been specified in the pattern, then the
+ * generation number after a dot will be added to the end of the file name.
  * <p>
- * The unique identifier, denoted by "%u" in the filename pattern will always be
- * 0 unless the <code>FileHandler</code> is unable to open the file. In that
- * case 1 is tried, then 2, and so on until a file is found that can be opened.
- * If "%u" was not present in the pattern but a unique number is required then a
- * dot and a unique number is added to the end of the filename, equivalent to
- * appending ".%u" to the pattern.
- * </p>
+ * The "%u" unique field is used to avoid conflicts and is set to 0 at first. If
+ * one {@code FileHandler} tries to open the filename which is currently in use
+ * by another process, it will repeatedly increment the unique number field and
+ * try again. If the "%u" component has not been included in the file name
+ * pattern and some contention on a file does occur, then a unique numerical
+ * value will be added to the end of the filename in question immediately to the
+ * right of a dot. The generation of unique IDs for avoiding conflicts is only
+ * guaranteed to work reliably when using a local disk file system.
  */
 public class FileHandler extends StreamHandler {
 
@@ -149,17 +142,17 @@
     int uniqueID = -1;
 
     /**
-     * Construct a <code>FileHandler</code> using <code>LogManager</code>
-     * properties or their default value
+     * Construct a {@code FileHandler} using {@code LogManager} properties or
+     * their default value.
      * 
      * @throws IOException
-     *             if any IO exception happened
+     *             if any I/O error occurs.
      * @throws SecurityException
-     *             if security manager exists and it determines that caller does
-     *             not have the required permissions to control this handler,
-     *             required permissions include
-     *             <code>LogPermission("control")</code> and other permission
-     *             like <code>FilePermission("write")</code>, etc.
+     *             if a security manager exists and it determines that the
+     *             caller does not have the required permissions to control this
+     *             handler; required permissions include
+     *             {@code LogPermission("control")},
+     *             {@code FilePermission("write")} etc.
      */
     public FileHandler() throws IOException {
         init(null, null, null, null);
@@ -386,27 +379,26 @@
     }
 
     /**
-     * Construct a <code>FileHandler</code>, the given name pattern is used
-     * as output filename, the file limit is set to zero(no limit), and the file
-     * count is set to one, other configuration using <code>LogManager</code>
-     * properties or their default value
-     * 
-     * This handler write to only one file and no amount limit.
-     * 
+     * Constructs a new {@code FileHandler}. The given name pattern is used as
+     * output filename, the file limit is set to zero (no limit), the file count
+     * is set to one; the remaining configuration is done using
+     * {@code LogManager} properties or their default values. This handler
+     * writes to only one file with no size limit.
+     *
      * @param pattern
-     *            the name pattern of output file
+     *            the name pattern for the output file.
      * @throws IOException
-     *             if any IO exception happened
+     *             if any I/O error occurs.
      * @throws SecurityException
-     *             if security manager exists and it determines that caller does
-     *             not have the required permissions to control this handler,
-     *             required permissions include
-     *             <code>LogPermission("control")</code> and other permission
-     *             like <code>FilePermission("write")</code>, etc.
-     * @throws NullPointerException
-     *             if the pattern is <code>null</code>.
+     *             if a security manager exists and it determines that the
+     *             caller does not have the required permissions to control this
+     *             handler; required permissions include
+     *             {@code LogPermission("control")},
+     *             {@code FilePermission("write")} etc.
      * @throws IllegalArgumentException
      *             if the pattern is empty.
+     * @throws NullPointerException
+     *             if the pattern is {@code null}.
      */
     public FileHandler(String pattern) throws IOException {
         if (pattern.equals("")) { //$NON-NLS-1$
@@ -418,30 +410,29 @@
     }
 
     /**
-     * Construct a <code>FileHandler</code>, the given name pattern is used
-     * as output filename, the file limit is set to zero(i.e. no limit applies),
-     * the file count is initialized to one, and the value of
-     * <code>append</code> becomes the new instance's append mode. Other
-     * configuration is done using <code>LogManager</code> properties.
-     * 
-     * This handler write to only one file and no amount limit.
-     * 
+     * Construct a new {@code FileHandler}. The given name pattern is used as
+     * output filename, the file limit is set to zero (no limit), the file count
+     * is initialized to one and the value of {@code append} becomes the new
+     * instance's append mode. The remaining configuration is done using
+     * {@code LogManager} properties. This handler writes to only one file
+     * with no size limit.
+     *
      * @param pattern
-     *            the name pattern of output file
+     *            the name pattern for the output file.
      * @param append
-     *            the append mode
+     *            the append mode.
      * @throws IOException
-     *             if any IO exception happened
+     *             if any I/O error occurs.
      * @throws SecurityException
-     *             if security manager exists and it determines that caller does
-     *             not have the required permissions to control this handler,
-     *             required permissions include
-     *             <code>LogPermission("control")</code> and other permission
-     *             like <code>FilePermission("write")</code>, etc.
-     * @throws NullPointerException
-     *             if the pattern is <code>null</code>.
+     *             if a security manager exists and it determines that the
+     *             caller does not have the required permissions to control this
+     *             handler; required permissions include
+     *             {@code LogPermission("control")},
+     *             {@code FilePermission("write")} etc.
      * @throws IllegalArgumentException
-     *             if the pattern is empty.
+     *             if {@code pattern} is empty.
+     * @throws NullPointerException
+     *             if {@code pattern} is {@code null}.
      */
     public FileHandler(String pattern, boolean append) throws IOException {
         if (pattern.equals("")) { //$NON-NLS-1$
@@ -453,34 +444,33 @@
     }
 
     /**
-     * Construct a <code>FileHandler</code>, the given name pattern is used
-     * as output filename, the file limit is set to given limit argument, and
-     * the file count is set to given count argument, other configuration using
-     * <code>LogManager</code> properties or their default value
-     * 
-     * This handler is configured to write to a rotating set of count files,
-     * when the limit of bytes has been written to one output file, another file
-     * will be opened instead.
-     * 
+     * Construct a new {@code FileHandler}. The given name pattern is used as
+     * output filename, the maximum file size is set to {@code limit} and the
+     * file count is initialized to {@code count}. The remaining configuration
+     * is done using {@code LogManager} properties. This handler is configured
+     * to write to a rotating set of count files, when the limit of bytes has
+     * been written to one output file, another file will be opened instead.
+     *
      * @param pattern
-     *            the name pattern of output file
+     *            the name pattern for the output file.
      * @param limit
-     *            the data amount limit in bytes of one output file, cannot less
-     *            than one
+     *            the data amount limit in bytes of one output file, can not be
+     *            negative.
      * @param count
-     *            the maximum number of files can be used, cannot less than one
+     *            the maximum number of files to use, can not be less than one.
      * @throws IOException
-     *             if any IO exception happened
+     *             if any I/O error occurs.
      * @throws SecurityException
-     *             if security manager exists and it determines that caller does
-     *             not have the required permissions to control this handler,
-     *             required permissions include
-     *             <code>LogPermission("control")</code> and other permission
-     *             like <code>FilePermission("write")</code>, etc.
-     * @throws NullPointerException
-     *             if pattern is <code>null</code>.
+     *             if a security manager exists and it determines that the
+     *             caller does not have the required permissions to control this
+     *             handler; required permissions include
+     *             {@code LogPermission("control")},
+     *             {@code FilePermission("write")} etc.
      * @throws IllegalArgumentException
-     *             if count<1, or limit<0
+     *             if {@code pattern} is empty, {@code limit < 0} or
+     *             {@code count < 1}.
+     * @throws NullPointerException
+     *             if {@code pattern} is {@code null}.
      */
     public FileHandler(String pattern, int limit, int count) throws IOException {
         if (pattern.equals("")) { //$NON-NLS-1$
@@ -495,37 +485,36 @@
     }
 
     /**
-     * Construct a <code>FileHandler</code>, the given name pattern is used
-     * as output filename, the file limit is set to given limit argument, the
-     * file count is set to given count argument, and the append mode is set to
-     * given append argument, other configuration using <code>LogManager</code>
-     * properties or their default value
-     * 
-     * This handler is configured to write to a rotating set of count files,
-     * when the limit of bytes has been written to one output file, another file
-     * will be opened instead.
-     * 
+     * Construct a new {@code FileHandler}. The given name pattern is used as
+     * output filename, the maximum file size is set to {@code limit}, the file
+     * count is initialized to {@code count} and the append mode is set to
+     * {@code append}. The remaining configuration is done using
+     * {@code LogManager} properties. This handler is configured to write to a
+     * rotating set of count files, when the limit of bytes has been written to
+     * one output file, another file will be opened instead.
+     *
      * @param pattern
-     *            the name pattern of output file
+     *            the name pattern for the output file.
      * @param limit
-     *            the data amount limit in bytes of one output file, cannot less
-     *            than one
+     *            the data amount limit in bytes of one output file, can not be
+     *            negative.
      * @param count
-     *            the maximum number of files can be used, cannot less than one
+     *            the maximum number of files to use, can not be less than one.
      * @param append
-     *            the append mode
+     *            the append mode.
      * @throws IOException
-     *             if any IO exception happened
+     *             if any I/O error occurs.
      * @throws SecurityException
-     *             if security manager exists and it determines that caller does
-     *             not have the required permissions to control this handler,
-     *             required permissions include
-     *             <code>LogPermission("control")</code> and other permission
-     *             like <code>FilePermission("write")</code>, etc.
-     * @throws NullPointerException
-     *             if pattern is <code>null</code>.
+     *             if a security manager exists and it determines that the
+     *             caller does not have the required permissions to control this
+     *             handler; required permissions include
+     *             {@code LogPermission("control")},
+     *             {@code FilePermission("write")} etc.
      * @throws IllegalArgumentException
-     *             if count<1, or limit<0
+     *             if {@code pattern} is empty, {@code limit < 0} or
+     *             {@code count < 1}.
+     * @throws NullPointerException
+     *             if {@code pattern} is {@code null}.
      */
     public FileHandler(String pattern, int limit, int count, boolean append)
             throws IOException {
@@ -542,14 +531,14 @@
     }
 
     /**
-     * Flush and close all opened files.
+     * Flushes and closes all opened files.
      * 
      * @throws SecurityException
-     *             if security manager exists and it determines that caller does
-     *             not have the required permissions to control this handler,
-     *             required permissions include
-     *             <code>LogPermission("control")</code> and other permission
-     *             like <code>FilePermission("write")</code>, etc.
+     *             if a security manager exists and it determines that the
+     *             caller does not have the required permissions to control this
+     *             handler; required permissions include
+     *             {@code LogPermission("control")},
+     *             {@code FilePermission("write")} etc.
      */
     @Override
     public void close() {
@@ -568,10 +557,10 @@
     }
 
     /**
-     * Publish a <code>LogRecord</code>
+     * Publish a {@code LogRecord}.
      * 
      * @param record
-     *            the log record to be published
+     *            the log record to publish.
      */
     @Override
     public void publish(LogRecord record) {
@@ -588,9 +577,9 @@
     }
 
     /**
-     * This output stream use decorator pattern to add measure feature to
-     * OutputStream which can detect the total size(in bytes) of output, the
-     * initial size can be set
+     * This output stream uses the decorator pattern to add measurement features
+     * to OutputStream which can detect the total size(in bytes) of output, the
+     * initial size can be set.
      */
     static class MeasureOutputStream extends OutputStream {
 

Modified: harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/Filter.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/Filter.java?rev=768698&r1=768697&r2=768698&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/Filter.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/Filter.java Sun Apr 26 12:30:01 2009
@@ -18,18 +18,18 @@
 package java.util.logging;
 
 /**
- * A Filter provides a mechanism for exercising fine-grained control over what
- * records get logged.
+ * A {@code Filter} provides a mechanism for exercising fine-grained control
+ * over which records get logged.
  */
 public interface Filter {
 
     /**
-     * Checks the {@link LogRecord} to determine if it should be logged.
+     * Checks {@code record} to determine if it should be logged.
      * 
      * @param record
-     *            The {@link LogRecord} to be checked.
-     * @return <code>true</code> if the supplied log record needs to be
-     *         logged, otherwise <code>false</code>
+     *            the {@link LogRecord} to be checked.
+     * @return {@code true} if the supplied log record needs to be logged,
+     *         {@code false} otherwise.
      */
     boolean isLoggable(LogRecord record);
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/Formatter.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/Formatter.java?rev=768698&r1=768697&r2=768698&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/Formatter.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/logging/src/main/java/java/util/logging/Formatter.java Sun Apr 26 12:30:01 2009
@@ -21,44 +21,45 @@
 import java.util.ResourceBundle;
 
 /**
- * <code>Formatter</code> objects are used to format <code>LogRecord</code>
- * objects into a string representation. Head and tail strings are sometime used
- * to wrap a set of records. The <code>getHead</code> and <code>getTail</code>
- * methods are presented for this purpose.
+ * {@code Formatter} objects are used to format {@link LogRecord} objects into a
+ * string representation. Head and tail strings are sometimes used to wrap a set
+ * of records. The {@code getHead} and {@code getTail} methods are used for this
+ * purpose.
  */
 public abstract class Formatter {
 
     /**
-     * Constructs a <code>Formatter</code> object.
+     * Constructs a {@code Formatter} object.
      */
     protected Formatter() {
         super();
     }
 
     /**
-     * Formats a <code>LogRecord</code> object into a string representation.
-     * The resulted string is usually localized and includes the message field
-     * of the supplied <code>LogRecord</code> object.
+     * Converts a {@link LogRecord} object into a string representation. The
+     * resulted string is usually localized and includes the message field of
+     * the record.
      * 
      * @param r
-     *            the log record to be formatted into a string
-     * @return the string resulted from the formatting
+     *            the log record to be formatted into a string.
+     * @return the formatted string.
      */
     public abstract String format(LogRecord r);
 
     /**
-     * Formats a <code>LogRecord</code> object into a localized string
-     * representation. This method can be regarded as a convenience for
-     * subclasses of <code>Formatter</code> to use.
+     * Formats a {@code LogRecord} object into a localized string
+     * representation. This is a convenience method for subclasses of {@code
+     * Formatter}.
      * <p>
-     * The message string is firstly localized using the
-     * <code>ResourceBundle</code> object associated with the supplied
-     * <code>LogRecord</code>.
-     * </p>
-     * 
+     * The message string is firstly localized using the {@code ResourceBundle}
+     * object associated with the supplied {@code LogRecord}.
+     * <p>
+     * Notice : if message contains "{0", then java.text.MessageFormat is used.
+     * Otherwise no formatting is performed.
+     *
      * @param r
-     *            the log record to be formatted
-     * @return the string resulted from the formatting
+     *            the log record to be formatted.
+     * @return the string resulted from the formatting.
      */
     public String formatMessage(LogRecord r) {
         String pattern = r.getMessage();
@@ -91,11 +92,12 @@
 
     /**
      * Gets the head string used to wrap a set of log records. This base class
-     * always returns the empty string.
+     * always returns an empty string.
      * 
      * @param h
-     *            the target handler
-     * @return the head string used to wrap a set of log records
+     *            the target handler.
+     * @return the head string used to wrap a set of log records, empty in this
+     *         implementation.
      */
     @SuppressWarnings("unused")
     public String getHead(Handler h) {
@@ -107,8 +109,9 @@
      * always returns the empty string.
      * 
      * @param h
-     *            the target handler
-     * @return the tail string used to wrap a set of log records
+     *            the target handler.
+     * @return the tail string used to wrap a set of log records, empty in this
+     *         implementation.
      */
     @SuppressWarnings("unused")
     public String getTail(Handler h) {



Mime
View raw message