Bug 128562

Summary: Javadoc of ITypeBinding#isAssignmentCompatible() is unclear
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: 3.2   
Target Milestone: 3.2 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Markus Keller CLA 2006-02-19 18:56:05 EST
I20060217-1115

The javadoc of ITypeBinding#isAssignmentCompatible() is not as crystal clear as it could be. The term "compatible" suggests that the relation is bidirectional, which is clearly not the case. Furthermore, JLS3 5.2 only defines assignment "conversion", not "compatibility".

A definition like this would make things much clearer (and would correct the typo in "assigment"):

/**
 * Returns whether an expression of this type can be assigned to a variable
 * of the given type, as specified in section 5.2 of <em>The Java Language 
 * Specification, Third Edition</em> (JLS3).
 * 
 * @param variableType the type of a variable to check compatibility against
 * @return <code>true</code> if an expression of this type can be assigned to a
 *   variable of the given type, and <code>false</code> otherwise
 * @since 3.1
 */
public boolean isAssignmentCompatible(ITypeBinding variableType);
Comment 1 Philipe Mulet CLA 2006-02-20 08:03:48 EST
Assignment is not a bidirectional relation; but improving doc is good if it is not super clear.

Comment 2 Philipe Mulet CLA 2006-04-06 08:54:48 EDT
+1 for 3.2RC1
Comment 3 Jerome Lanneluc CLA 2006-04-06 11:24:04 EDT
Released proposed change.
Comment 4 Frederic Fusier CLA 2006-04-13 12:39:05 EDT
Verified for 3.2 RC1 using build I20060413-0010.