Bug 167591 - [quick assist] 'Convert anonymous to nested class': make static if possible
Summary: [quick assist] 'Convert anonymous to nested class': make static if possible
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-12 06:36 EST by Dani Megert CLA
Modified: 2023-12-17 15:02 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2006-12-12 06:36:21 EST
I20061212-0010

Have:
public class Bug {
	void foo() {
		new Bug() {
			void fooBar() {
			}
		}.fooBar();
	}
}

Using the 'Convert anonymous to nested class' quick assist forces me to
1. use final
2. not use static

I have to manually fix this up each time to match my desired default signature.
Comment 1 Dani Megert CLA 2006-12-12 06:37:40 EST
You could argue that this is an enhancement but the way it currently works I probably wouldn't use that feature and go for the refactoring.
Comment 2 Martin Aeschlimann CLA 2006-12-13 10:08:15 EST
The inner class should be created static if possible. Final makes sense too. But note that static will be the exception, most anonymous classes reference instance methods.

I believe having a dialog is nicer than manually changing modifiers, but of course that's a matter of taste.
Comment 3 Martin Aeschlimann CLA 2006-12-13 10:10:59 EST
hm, I wanted to say 'takes more time than'
Comment 4 Dani Megert CLA 2006-12-13 10:24:46 EST
>hm, I wanted to say 'takes more time than'
How's that related to previous comments?
Comment 5 Eclipse Genie CLA 2020-01-02 16:45:24 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 6 Eclipse Genie CLA 2021-12-26 13:48:06 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 7 Eclipse Genie CLA 2023-12-17 15:02:14 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.