Summary: | [quick assist] Join variable declaration quick fix should be proposed for initialized variables of primitive type | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Dani Megert <daniel_megert> |
Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
Status: | ASSIGNED --- | QA Contact: | |
Severity: | enhancement | ||
Priority: | P3 | CC: | ankur_sharma, deepakazad, markus.kell.r, Olivier_Thomann, wmitsuda |
Version: | 3.5 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: | |||
Bug Depends on: | 287123 | ||
Bug Blocks: |
Description
Dani Megert
2011-05-03 09:44:14 EDT
The fix for Bug 287123 was to offer 'Join variable declaration' quick assist when the initializer is *null*. If the initializer is not null then the quick assist is not offered, because the initializer may be important to the user and we do not want to delete it silently/without warning. So what needs to be done for primitive types ? Offer the quick assist when the variable is initialized to the default value of the primitive type ? e.g. int i= 0; or boolean b= false; In my opinion we should not do this, as this would be confusing. > So what needs to be done for primitive types ? Offer the quick assist when the > variable is initialized to the default value of the primitive type ? e.g. int > i= 0; or boolean b= false; Yes. > In my opinion we should not do this, as this would be confusing. Why should we treat the default value for objects different from the primitive ones? Double d= 0d; Double d= 0.0d; Double d= 0.00d; - In which case is the quick assist offered? (rhetorical question) - And from a user perspective there is no scope of confusion here? (In reply to comment #3) > Double d= 0d; > Double d= 0.0d; > Double d= 0.00d; > - In which case is the quick assist offered? (rhetorical question) In none, as those assign real objects which are different from the object default ('null'). > - And from a user perspective there is no scope of confusion here? Why? oops.. the D is double was supposed to be lower case double d= 0d; double d= 0.0d; double d= 0.00d; > double d= 0d;
> double d= 0.0d;
> double d= 0.00d;
Those are all identical to the default (0.0d) and hence the quick assist should be there.
|