Community
Participate
Working Groups
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.
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 */
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()
Spec looks good.
Released, and adapted implementation accordingly. Added tests ASTConverter15Test#test174-175.
Verified in I20050510-0010