Getter/Setter Code Generation in Java

All:

I have noticed that as I write Java code with the EAP build I constantly have the Code->Generate option become unavailable when I am pretty sure it should be available. I also see that the Reformat option is available but when I click it nothing happens.

Is this occurring for others or is it some dumb user error thing? I have tried simply restarting the editor, but that can sure slow me down when I am just trying to save myself from having to type boring getter/setter code myself.

Thoughts? Comments?

-AP

7 comments
Comment actions Permalink

I've noticed a general lag in the inspections & intention suggestions popping up in recent IDEA 9 EAPs. For example with importing a class. I've seen a couple of brief posts here and there in the forums about it. I'm not sure if anyone has opened a YouTrack issue on it or not. I'm about to head out somewhere, so I can't take a look at the moment. But if you find one, or want to open one, post the info here so others can vote for it.

0
Comment actions Permalink

Are you using spring?

At some point in 8.x, there was a delay for the generate menu to appear in case the class was used as a spring bean.
However, I think that issue has been fixed a long time ago.

-tt

0
Comment actions Permalink

I am using spring - but when I first started using it on this project things worked as expected.

All of a sudden last night code generation and the ability to reformat code stopped working.

Is there some cache or project setting I should invalidate. I tried reimporting all the projects and still didn't find any success.

Just checked for a bug and didn't really see anyone with the same problem, there are bugs open on getter/setter generation though but I think they are more or less feature requests for changes in the way it works.

0
Comment actions Permalink

I've been using the 9.0 EAP since it started, and I'm not aware of any such issues.
'Invalidate caches' is worth trying.

Apart from that, what exact version are you using? Do you see any error messages in 'idea.log' after the popup fails to show?

-tt

0
Comment actions Permalink

I'm always using the very convenient Ctrl+N shortcut to get the Code
generation context menu.
It hasn't stopped working AFAIK.

Speaking of Accessors/Mutators generation, it'd be great to have the
option to generate them inline.
e.g.
public void setField(String value) {this.value = value;}

or to be able to format code with an "inline" option.

rgds
On 2009-11-30 14:11:37 +0900, Adam Parrish <no_reply@jetbrains.com> said:

All:

I have noticed that as I write Java code with the EAP build I
constantly have the Code->Generate option become unavailable when I am
pretty sure it should be available. I also see that the Reformat option
is available but when I click it nothing happens.

Is this occurring for others or is it some dumb user error thing? I
have tried simply restarting the editor, but that can sure slow me down
when I am just trying to save myself from having to type boring
getter/setter code myself.

Thoughts? Comments?

-AP

---
Original message URL: http://www.jetbrains.net/devnet/message/5251210#5251210



0
Comment actions Permalink

I'd prefer to automatically collapse such simple setters/getters by default.

0
Comment actions Permalink

Just upgraded to the newest EAP and my problems are gone.

Kind of frustrating when time saving features disappear when you need them but are there when you dont

Hopefully this will just stop happening in the non-EAP build or Release version.

0

Please sign in to leave a comment.