jdk/src/share/classes/java/lang/reflect/Method.java
changeset 16743 b0b34102bb4c
parent 16729 3b26e313ad81
child 16906 44dfee24cb71
--- a/jdk/src/share/classes/java/lang/reflect/Method.java	Mon Apr 08 16:37:35 2013 -0700
+++ b/jdk/src/share/classes/java/lang/reflect/Method.java	Mon Apr 08 17:06:20 2013 -0700
@@ -342,9 +342,8 @@
      * specified by "The Java Language Specification".  This is
      * {@code public}, {@code protected} or {@code private} first,
      * and then other modifiers in the following order:
-     * {@code abstract}, {@code static}, {@code final},
-     * {@code synchronized}, {@code native}, {@code strictfp},
-     * {@code default}.
+     * {@code abstract}, {@code default}, {@code static}, {@code final},
+     * {@code synchronized}, {@code native}, {@code strictfp}.
      *
      * @return a string describing this {@code Method}
      *
@@ -359,8 +358,8 @@
 
     @Override
     void specificToStringHeader(StringBuilder sb) {
-        sb.append(Field.getTypeName(getReturnType())).append(' ');
-        sb.append(Field.getTypeName(getDeclaringClass())).append('.');
+        sb.append(getReturnType().getTypeName()).append(' ');
+        sb.append(getDeclaringClass().getTypeName()).append('.');
         sb.append(getName());
     }
 
@@ -387,16 +386,14 @@
      * class name.  If the method is declared to throw exceptions, the
      * parameter list is followed by a space, followed by the word
      * throws followed by a comma-separated list of the generic thrown
-     * exception types.  If there are no type parameters, the type
-     * parameter list is elided.
+     * exception types.
      *
      * <p>The access modifiers are placed in canonical order as
      * specified by "The Java Language Specification".  This is
      * {@code public}, {@code protected} or {@code private} first,
      * and then other modifiers in the following order:
-     * {@code abstract}, {@code static}, {@code final},
-     * {@code synchronized}, {@code native}, {@code strictfp},
-     * {@code default}.
+     * {@code abstract}, {@code default}, {@code static}, {@code final},
+     * {@code synchronized}, {@code native}, {@code strictfp}.
      *
      * @return a string describing this {@code Method},
      * include type parameters
@@ -413,11 +410,8 @@
     @Override
     void specificToGenericStringHeader(StringBuilder sb) {
         Type genRetType = getGenericReturnType();
-        sb.append( ((genRetType instanceof Class<?>)?
-                    Field.getTypeName((Class<?>)genRetType):genRetType.toString()))
-            .append(' ');
-
-        sb.append(Field.getTypeName(getDeclaringClass())).append('.');
+        sb.append(genRetType.getTypeName()).append(' ');
+        sb.append(getDeclaringClass().getTypeName()).append('.');
         sb.append(getName());
     }