7110111: Minor Java SE javadoc & Constructor clean up
authorlancea
Thu, 10 Nov 2011 11:41:27 -0500
changeset 11016 e2665f4ac6d2
parent 11015 cc6fd1f079de
child 11017 353f81426721
7110111: Minor Java SE javadoc & Constructor clean up Reviewed-by: alanb, darcy Contributed-by: Martin Desruisseaux <martin.desruisseaux@geomatys.fr>
jdk/src/share/classes/java/io/Writer.java
jdk/src/share/classes/java/lang/AssertionError.java
jdk/src/share/classes/java/lang/Class.java
jdk/src/share/classes/java/lang/Double.java
jdk/src/share/classes/java/lang/Float.java
jdk/src/share/classes/java/sql/PreparedStatement.java
jdk/src/share/classes/java/sql/Statement.java
jdk/src/share/classes/java/util/jar/Attributes.java
--- a/jdk/src/share/classes/java/io/Writer.java	Thu Nov 10 15:41:49 2011 +0000
+++ b/jdk/src/share/classes/java/io/Writer.java	Thu Nov 10 11:41:27 2011 -0500
@@ -57,7 +57,7 @@
     /**
      * Size of writeBuffer, must be >= 1
      */
-    private final int writeBufferSize = 1024;
+    private static final int WRITE_BUFFER_SIZE = 1024;
 
     /**
      * The object used to synchronize operations on this stream.  For
@@ -107,7 +107,7 @@
     public void write(int c) throws IOException {
         synchronized (lock) {
             if (writeBuffer == null){
-                writeBuffer = new char[writeBufferSize];
+                writeBuffer = new char[WRITE_BUFFER_SIZE];
             }
             writeBuffer[0] = (char) c;
             write(writeBuffer, 0, 1);
@@ -180,9 +180,9 @@
     public void write(String str, int off, int len) throws IOException {
         synchronized (lock) {
             char cbuf[];
-            if (len <= writeBufferSize) {
+            if (len <= WRITE_BUFFER_SIZE) {
                 if (writeBuffer == null) {
-                    writeBuffer = new char[writeBufferSize];
+                    writeBuffer = new char[WRITE_BUFFER_SIZE];
                 }
                 cbuf = writeBuffer;
             } else {    // Don't permanently allocate very large buffers.
--- a/jdk/src/share/classes/java/lang/AssertionError.java	Thu Nov 10 15:41:49 2011 +0000
+++ b/jdk/src/share/classes/java/lang/AssertionError.java	Thu Nov 10 11:41:27 2011 -0500
@@ -71,7 +71,7 @@
      * @see   Throwable#getCause()
      */
     public AssertionError(Object detailMessage) {
-        this("" +  detailMessage);
+        this(String.valueOf(detailMessage));
         if (detailMessage instanceof Throwable)
             initCause((Throwable) detailMessage);
     }
@@ -85,7 +85,7 @@
      * @param detailMessage value to be used in constructing detail message
      */
     public AssertionError(boolean detailMessage) {
-        this("" +  detailMessage);
+        this(String.valueOf(detailMessage));
     }
 
     /**
@@ -97,7 +97,7 @@
      * @param detailMessage value to be used in constructing detail message
      */
     public AssertionError(char detailMessage) {
-        this("" +  detailMessage);
+        this(String.valueOf(detailMessage));
     }
 
     /**
@@ -109,7 +109,7 @@
      * @param detailMessage value to be used in constructing detail message
      */
     public AssertionError(int detailMessage) {
-        this("" +  detailMessage);
+        this(String.valueOf(detailMessage));
     }
 
     /**
@@ -121,7 +121,7 @@
      * @param detailMessage value to be used in constructing detail message
      */
     public AssertionError(long detailMessage) {
-        this("" +  detailMessage);
+        this(String.valueOf(detailMessage));
     }
 
     /**
@@ -133,7 +133,7 @@
      * @param detailMessage value to be used in constructing detail message
      */
     public AssertionError(float detailMessage) {
-        this("" +  detailMessage);
+        this(String.valueOf(detailMessage));
     }
 
     /**
@@ -145,7 +145,7 @@
      * @param detailMessage value to be used in constructing detail message
      */
     public AssertionError(double detailMessage) {
-        this("" +  detailMessage);
+        this(String.valueOf(detailMessage));
     }
 
     /**
--- a/jdk/src/share/classes/java/lang/Class.java	Thu Nov 10 15:41:49 2011 +0000
+++ b/jdk/src/share/classes/java/lang/Class.java	Thu Nov 10 11:41:27 2011 -0500
@@ -3008,7 +3008,7 @@
 
     /**
      * Casts this {@code Class} object to represent a subclass of the class
-     * represented by the specified class object.  Checks that that the cast
+     * represented by the specified class object.  Checks that the cast
      * is valid, and throws a {@code ClassCastException} if it is not.  If
      * this method succeeds, it always returns a reference to this class object.
      *
--- a/jdk/src/share/classes/java/lang/Double.java	Thu Nov 10 15:41:49 2011 +0000
+++ b/jdk/src/share/classes/java/lang/Double.java	Thu Nov 10 11:41:27 2011 -0500
@@ -607,8 +607,7 @@
      * @see       java.lang.Double#valueOf(java.lang.String)
      */
     public Double(String s) throws NumberFormatException {
-        // REMIND: this is inefficient
-        this(valueOf(s).doubleValue());
+        value = parseDouble(s);
     }
 
     /**
--- a/jdk/src/share/classes/java/lang/Float.java	Thu Nov 10 15:41:49 2011 +0000
+++ b/jdk/src/share/classes/java/lang/Float.java	Thu Nov 10 11:41:27 2011 -0500
@@ -529,8 +529,7 @@
      * @see        java.lang.Float#valueOf(java.lang.String)
      */
     public Float(String s) throws NumberFormatException {
-        // REMIND: this is inefficient
-        this(valueOf(s).floatValue());
+        value = parseFloat(s);
     }
 
     /**
--- a/jdk/src/share/classes/java/sql/PreparedStatement.java	Thu Nov 10 15:41:49 2011 +0000
+++ b/jdk/src/share/classes/java/sql/PreparedStatement.java	Thu Nov 10 11:41:27 2011 -0500
@@ -767,7 +767,7 @@
 
 
     /**
-     * Sets the designated paramter to the given <code>String</code> object.
+     * Sets the designated parameter to the given <code>String</code> object.
      * The driver converts this to a SQL <code>NCHAR</code> or
      * <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value
      * (depending on the argument's
--- a/jdk/src/share/classes/java/sql/Statement.java	Thu Nov 10 15:41:49 2011 +0000
+++ b/jdk/src/share/classes/java/sql/Statement.java	Thu Nov 10 11:41:27 2011 -0500
@@ -991,7 +991,7 @@
         /**
          * Requests that a <code>Statement</code> be pooled or not pooled.  The value
          * specified is a hint to the statement pool implementation indicating
-         * whether the applicaiton wants the statement to be pooled.  It is up to
+         * whether the application wants the statement to be pooled.  It is up to
          * the statement pool manager as to whether the hint is used.
          * <p>
          * The poolable value of a statement is applicable to both internal
--- a/jdk/src/share/classes/java/util/jar/Attributes.java	Thu Nov 10 15:41:49 2011 +0000
+++ b/jdk/src/share/classes/java/util/jar/Attributes.java	Thu Nov 10 11:41:27 2011 -0500
@@ -629,7 +629,7 @@
         public static final Name IMPLEMENTATION_VENDOR_ID = new Name("Implementation-Vendor-Id");
 
        /**
-         * <code>Name</code> object for <code>Implementation-Vendor-URL</code>
+         * <code>Name</code> object for <code>Implementation-URL</code>
          * manifest attribute used for package versioning.
          * @see <a href="../../../../technotes/guides/versioning/spec/versioning2.html#wp90779">
          *      Java Product Versioning Specification</a>