Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 107985 - [quick fix] Create Method in void context should 'box' void.
Summary: [quick fix] Create Method in void context should 'box' void.
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 3.5 M1   Edit
Assignee: Martin Aeschlimann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-25 09:54 EDT by David Corbin CLA
Modified: 2008-08-05 09:04 EDT (History)
3 users (show)

See Also:


Attachments
patch (3.13 KB, patch)
2008-07-01 19:28 EDT, Benjamin Muskalla CLA
daniel_megert: iplog+
Details | Diff
copyright (1.95 KB, patch)
2008-07-02 14:38 EDT, Benjamin Muskalla CLA
daniel_megert: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Corbin CLA 2005-08-25 09:54:42 EDT
if I have a method call:

foo()

and I select 'create method foo()', Eclipse generates

private void foo() {
}

with 'private' and 'foo' in "boxes' that allow easy tabbing between and share
edit changes (in the case of foo). 'void' should also be in tab-enabled box.
Comment 1 Benjamin Muskalla CLA 2008-07-01 19:28:49 EDT
Created attachment 106267 [details]
patch

I stumbled across this several times so here is a patch.

One concern which could be commented by the team:
Current situation is that if the return type is void there is no return statement created which is perfectly ok. As the void is now linked too, it would maybe make sense to still create a return statement. Changing the return type trough the linked mode would lead to an error marker in both cases
* case 1 without return -> marker to introduce return
* case 2 with return -> marker that return has to return something :)
Not sure what would be the better user expierence
Comment 2 Martin Aeschlimann CLA 2008-07-02 08:35:12 EDT
I'm not sure if adding a 'return;' will be useful in the general case.

A quick fix will help you add the missing return statement. So I think we leave things as they are.

patch released > 20080702

Comment 3 Benjamin Muskalla CLA 2008-07-02 14:38:04 EDT
Created attachment 106340 [details]
copyright

Martin, as good eclipse citizanships we need this patch too.
Sorry that I forgot it the first time.
Comment 4 Markus Keller CLA 2008-08-05 09:04:39 EDT
Verified in I20080805-0100. Released copyright as well (for next build).