Bug 88202 - Javadoc: clarify ITypeBinding#getTypeBounds()
Summary: Javadoc: clarify ITypeBinding#getTypeBounds()
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 trivial (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Jim des Rivieres CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 92982
  Show dependency tree
 
Reported: 2005-03-16 12:23 EST by Markus Keller CLA
Modified: 2005-05-11 09:04 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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