Summary: | Javadoc of ITypeBinding#getErasure() is wrong for array types | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> |
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.1 | ||
Target Milestone: | 3.1 RC2 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Markus Keller
2005-06-08 10:34:36 EDT
+1 for RC2 Jim, Could you please cover the array type case in the erasure()? The implementation is correct. Here is the updated spec. /** * Returns the erasure of this type binding. * <ul> * <li>For parameterized types ({@link #isParameterizedType()}) * - returns the binding for the corresponding generic type.</li> * <li>For raw types ({@link #isRawType()}) * - returns the binding for the corresponding generic type.</li> * <li>For wildcard types ({@link #isWildcardType()}) * - returns the binding for the upper bound if it has one and * java.lang.Object in other cases.</li> * <li>For type variables ({@link #isTypeVariable()}) * - returns the binding for the erasure of the leftmost bound * if it has bounds and java.lang.Object if it does not.</li> * <li>For captures ({@link #isCapture()}) * - returns the binding for the erasure of the leftmost bound * if it has bounds and java.lang.Object if it does not.</li> * <li>For array types ({@link #isArray()}) - returns an array type * for which the element type is the erasure of the element type * ({@link #getElementType()}) of this type binding.</li> * <li>For all other type bindings - returns the identical binding.</li> * </ul> * * @return the erasure type binding * @since 3.1 */ public ITypeBinding getErasure(); See the part about array types. Change brings spec into line with implemented behavior. API spec change approved for 3.1RC2. The updated spec is still not fully complete, since it does not mention that the erasure has the same dimensions as the receiver. /** * Returns the erasure of this type binding. * <ul> * <li>For parameterized types ({@link #isParameterizedType()}) * - returns the binding for the corresponding generic type.</li> * <li>For raw types ({@link #isRawType()}) * - returns the binding for the corresponding generic type.</li> * <li>For wildcard types ({@link #isWildcardType()}) * - returns the binding for the upper bound if it has one and * java.lang.Object in other cases.</li> * <li>For type variables ({@link #isTypeVariable()}) * - returns the binding for the erasure of the leftmost bound * if it has bounds and java.lang.Object if it does not.</li> * <li>For captures ({@link #isCapture()}) * - returns the binding for the erasure of the leftmost bound * if it has bounds and java.lang.Object if it does not.</li> * <li>For array types ({@link #isArray()}) - returns an array type of * the same dimension ({@link #getDimensions()}) than this type * binding for which the element type is the erasure of the element type * ({@link #getElementType()}) of this type binding.</li> * <li>For all other type bindings - returns the identical binding.</li> * </ul> * * @return the erasure type binding * @since 3.1 */ public ITypeBinding getErasure(); is this better? Fixed and released the following version. /** * Returns the erasure of this type binding. * <ul> * <li>For parameterized types ({@link #isParameterizedType()}) * - returns the binding for the corresponding generic type.</li> * <li>For raw types ({@link #isRawType()}) * - returns the binding for the corresponding generic type.</li> * <li>For wildcard types ({@link #isWildcardType()}) * - returns the binding for the upper bound if it has one and * java.lang.Object in other cases.</li> * <li>For type variables ({@link #isTypeVariable()}) * - returns the binding for the erasure of the leftmost bound * if it has bounds and java.lang.Object if it does not.</li> * <li>For captures ({@link #isCapture()}) * - returns the binding for the erasure of the leftmost bound * if it has bounds and java.lang.Object if it does not.</li> * <li>For array types ({@link #isArray()}) - returns an array type of * the same dimension ({@link #getDimensions()}) as this type * binding for which the element type is the erasure of the element type * ({@link #getElementType()}) of this type binding.</li> * <li>For all other type bindings - returns the identical binding.</li> * </ul> * * @return the erasure type binding * @since 3.1 */ public ITypeBinding getErasure(); Jim, could you please review for English correctness? the wording is fine. Verified with N20050609-0010 + JDT/Core HEAD Verified for 3.1 RC2 using build I20050610-0010 |