Introduce Variable/Extract Method: definition of "expression"

I have a hunk of code that looks like this (sanitized):

if (foo != null && foo.getID() > 0
&& bar.isA() && !bar.isB())
{

When I select the text "bar.isA() && !bar.isB()" and try to introduce a variable or extract a method, I get an error popup message to effect that I have to select an expression. If I, however, select all of the text within the if ("foo != null && foo.getID() > 0 && bar.isA() && !bar.isB()"), I don't get the error popup.

It seems to me that "bar.isA() && !bar.isB()" is a valid expression. Am I getting confused, or is there a bug here?

3 comments
Comment actions Permalink

Kendall Collett wrote:

I have a hunk of code that looks like this (sanitized):

if (foo != null && foo.getID() > 0
&& bar.isA() && !bar.isB())
{

When I select the text "bar.isA() && !bar.isB()" and try to introduce a
variable or extract a method, I get an error popup message to effect that
I have to select an expression. If I, however, select all of the text
within the if ("foo != null && foo.getID() > 0 && bar.isA() &&
!bar.isB()"), I don't get the error popup.

It seems to me that "bar.isA() && !bar.isB()" is a valid expression. Am I
getting confused, or is there a bug here?


Kendall,
this is a known bug, sitting there to be fixed at some point.

Friendly,
Dmitry
--
Dmitry Lomov
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Kendall Collett wrote:

>> Kendall,
>> this is a known bug, sitting there to be fixed at
>> some point.


Are you referring to tracker item #6166
(http://www.intellij.net/tracker/idea/viewSCR?publicId=6166) or is it some
other bug you're thinking of? (I want to vote!)


Right. Go ahead.

Friendly,
Dmitry
--
Dmitry Lomov
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Kendall,
this is a known bug, sitting there to be fixed at
some point.


Are you referring to tracker item #6166 (http://www.intellij.net/tracker/idea/viewSCR?publicId=6166) or is it some other bug you're thinking of? (I want to vote!)

0

Please sign in to leave a comment.