Terry C. Martin

Tuesday, March 01, 2011

Netbeans Beta 7.0 - Introduce Field

Here's another one - this is less functional than Eclipse's version. Let's say I have this code:

GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();

in a method and I decide I want ge to become a field in my class. In eclipse, I'd select ge and choose 'convert local variable to field' under the 'refactor' menu. Eclipse would then replace the left side of that statement: "GraphicsEnvironment ge", with just "ge" and it would create the field up at the top of the class.

In Netbeans, I apparently must select the right-hand-side of the statement, then choose the Introduce Field option under refactor, which will ask me to create a field name, rather than take the field name I already created. This sucks because it won't just use the declaration I already have, 'ge' in this case. That means that if I already have code below that declaration, which is referring to my variable, and I then introduce a new field with a new variable name, I have to go through the hassle of replacing references to the previous variable with the new field name.

As I mentioned in my previous post - please Netbeans devs, just copy the functionality of Eclipse/IntelliJ... VERBATIM. Don't try to be innovative or different. Just blatantly rip-off the other two players. Only after you've shamelessly ripped the other guys off may you then proceed to innovate.

0 Comments:

Post a Comment

<< Home