changeset 8394:ca0957f0d408

8012937: Correct errors in javadoc comments. Summary: Correct some errors in the javadoc comments for parameter reflection. Reviewed-by: darcy
author emc
date Thu, 25 Apr 2013 14:23:24 -0400
parents 4da1d43f5843
children 5871d7b1673c
files src/share/classes/java/lang/reflect/Executable.java src/share/classes/java/lang/reflect/Parameter.java
diffstat 2 files changed, 10 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/lang/reflect/Executable.java	Thu Apr 25 09:37:03 2013 -0700
+++ b/src/share/classes/java/lang/reflect/Executable.java	Thu Apr 25 14:23:24 2013 -0400
@@ -237,8 +237,8 @@
     public abstract Class<?>[] getParameterTypes();
 
     /**
-     * Returns the number of formal parameters (including any
-     * synthetic or synthesized parameters) for the executable
+     * Returns the number of formal parameters (whether explicitly
+     * declared or implicitly declared or neither) for the executable
      * represented by this object.
      *
      * @return The number of formal parameters for the executable this
--- a/src/share/classes/java/lang/reflect/Parameter.java	Thu Apr 25 09:37:03 2013 -0700
+++ b/src/share/classes/java/lang/reflect/Parameter.java	Thu Apr 25 14:23:24 2013 -0400
@@ -148,19 +148,15 @@
     }
 
     /**
-     * Returns the name of the parameter.  The names of the parameters
-     * of a single executable must all the be distinct.  When names
-     * from the originating source are available, they are returned.
-     * Otherwise, an implementation of this method is free to create a
-     * name of this parameter, subject to the unquiness requirments.
+     * Returns the name of the parameter.  If the parameter's name is
+     * defined in a class file, then that name will be returned by
+     * this method.  Otherwise, this method will synthesize a name of
+     * the form argN, where N is the index of the parameter.
      */
     public String getName() {
-        // As per the spec, if a parameter has no name, return argX,
-        // where x is the index.
-        //
-        // Note: spec updates now outlaw empty strings as parameter
-        // names.  The .equals("") is for compatibility with current
-        // JVM behavior.  It may be removed at some point.
+        // Note: empty strings as paramete names are now outlawed.
+        // The .equals("") is for compatibility with current JVM
+        // behavior.  It may be removed at some point.
         if(name == null || name.equals(""))
             return "arg" + index;
         else
@@ -311,6 +307,6 @@
                 declaredAnnotations.put(ann[i].annotationType(), ann[i]);
         }
         return declaredAnnotations;
-    }
+   }
 
 }