Bug 344569 - [quick assist] Join variable declaration quick fix should be proposed for initialized variables of primitive type
Summary: [quick assist] Join variable declaration quick fix should be proposed for ini...
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 287123
Blocks:
  Show dependency tree
 
Reported: 2011-05-03 09:44 EDT by Dani Megert CLA
Modified: 2011-05-04 04:59 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2011-05-03 09:44:14 EDT
+++ This bug was initially created as a clone of Bug #287123 +++

Support is missing for primitives.
Comment 1 Deepak Azad CLA 2011-05-03 13:20:31 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.
Comment 2 Dani Megert CLA 2011-05-04 03:24:19 EDT
> 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?
Comment 3 Deepak Azad CLA 2011-05-04 04:21:14 EDT
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?
Comment 4 Dani Megert CLA 2011-05-04 04:28:33 EDT
(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?
Comment 5 Deepak Azad CLA 2011-05-04 04:45:53 EDT
oops.. the D is double was supposed to be lower case

double d= 0d;
double d= 0.0d;
double d= 0.00d;
Comment 6 Dani Megert CLA 2011-05-04 04:59:14 EDT
> 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.