Bug 88202

Summary: Javadoc: clarify ITypeBinding#getTypeBounds()
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Jim des Rivieres <jeem>
Status: VERIFIED FIXED QA Contact:
Severity: trivial    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 92982    

Description Markus Keller CLA 2005-03-16 12:23:53 EST
v_541

Some clarifications to the javadoc of ITypeBinding#getTypeBounds():

- "@return the list of type bindings" should be
  "@return the list of type *bounds*"

- it should be mentioned that the first type bound is always a class type, and
that java.lang.Object is used as first bound when the type variable does not
explicitly declare a class type bound.
Comment 1 Jim des Rivieres CLA 2005-04-20 23:32:23 EDT
Improved spec as follows:

/**
 * Returns the type bounds of this type variable.
 * <p>
 * Note that the first type bound is always a class type. If the type
 * variable does not explicitly declare a class type bound, the first
 * type bound will be the binding for <code>java.lang.Object</code>.
 * </p>
 *
 * @return the list of type bound for this type variable, or otherwise
 * the empty list
 * @see #isTypeVariable()
 * @since 3.1
 */
Comment 2 Philipe Mulet CLA 2005-04-28 18:26:31 EDT
I am proposing an adjustment of the spec and implementation, after discussion
with Markus. The bounds should only reflect explicitly declared ones.

/**
 * Returns the declared type bounds of this type variable or capture. If the
 * variable or the capture had no explicit bound, then it returns an empty list.
 * <p>
 * Note that per construction, it can only contain one class or array type, 
 * at most, and then it is located in first position.
 * </p>
 * Also note that array type bound may only occur in the case of a capture
 * binding, e.g. <code>capture-of ? extends Object[]</code>
 * </p>
 *
 * @return the list of type bindings for this type variable or capture,
 * or otherwise the empty list
 * @see #isCapture()
 * @see #isTypeVariable()
 * @since 3.1
 */


One can always find implicit supertypes using #getSuperclass() and
#getSuperInterfaces()
Comment 3 Jim des Rivieres CLA 2005-04-28 18:34:29 EDT
Spec looks good.
Comment 4 Philipe Mulet CLA 2005-04-29 07:43:02 EDT
Released, and adapted implementation accordingly.
Added tests ASTConverter15Test#test174-175.
Comment 5 Olivier Thomann CLA 2005-05-11 09:04:17 EDT
Verified in I20050510-0010