Review request for 6857803 Missing links to exceptions in javadoc for Class.getGeneric{Superclass, Interfaces}

Joseph D. Darcy Joe.Darcy at Sun.COM
Tue Jul 7 16:10:07 UTC 2009


Christopher Hegarty -Sun Microsystems Ireland wrote:
> Hi Joe,
>
> The changes look good, but could I ask you to make the same change to 
> the throws param for getTypeParameters. It looks like it has the same 
> issue.

Good catch; I'll fix that too.

Thanks,

-Joe

>
> Thanks,
> -Chris.
>
> Joe Darcy wrote:
>> Hello.
>>
>> Below is a simple patch for JDK 7 to fix a minor javadoc problem in 
>> java.lang.Clas.  The javadoc for methods getGenericSuperclass and 
>> getGenericInterfaces make @throws reference to two exceptions in the 
>> java.lang.reflect package; these exceptions don't get rendered as 
>> links in the HTML output because they are in a different package.  
>> The fix is to add the package qualification; importing the exceptions 
>> would have worked too, but the imports are not needed by the code in 
>> java.lang.Class.
>>
>> Thanks,
>>
>> -Joe
>>
>> --- old/src/share/classes/java/lang/Class.java    2009-07-06 
>> 21:31:15.000000000 -0700
>> +++ new/src/share/classes/java/lang/Class.java    2009-07-06 
>> 21:31:15.000000000 -0700
>> @@ -673,12 +673,12 @@
>>     * {@code Class} object representing the {@code Object} class is
>>     * returned.
>>     *
>> -     * @throws GenericSignatureFormatError if the generic
>> +     * @throws java.lang.reflect.GenericSignatureFormatError if the 
>> generic
>>     *     class signature does not conform to the format specified in 
>> the
>>     *     Java Virtual Machine Specification, 3rd edition
>>     * @throws TypeNotPresentException if the generic superclass
>>     *     refers to a non-existent type declaration
>> -     * @throws MalformedParameterizedTypeException if the
>> +     * @throws java.lang.reflect.MalformedParameterizedTypeException 
>> if the
>>     *     generic superclass refers to a parameterized type that 
>> cannot be
>>     *     instantiated  for any reason
>>     * @return the superclass of the class represented by this object
>> @@ -795,14 +795,14 @@
>>     * <p>If this object represents a primitive type or void, the
>>     * method returns an array of length 0.
>>     *
>> -     * @throws GenericSignatureFormatError
>> +     * @throws java.lang.reflect.GenericSignatureFormatError
>>     *     if the generic class signature does not conform to the format
>>     *     specified in the Java Virtual Machine Specification, 3rd 
>> edition
>>     * @throws TypeNotPresentException if any of the generic
>>     *     superinterfaces refers to a non-existent type declaration
>> -     * @throws MalformedParameterizedTypeException if any of the
>> -     *     generic superinterfaces refer to a parameterized type 
>> that cannot
>> -     *     be instantiated  for any reason
>> +     * @throws java.lang.reflect.MalformedParameterizedTypeException
>> +     *     if any of the generic superinterfaces refer to a 
>> parameterized
>> +     *     type that cannot be instantiated for any reason
>>     * @return an array of interfaces implemented by this class
>>     * @since 1.5
>>     */




More information about the core-libs-dev mailing list