Hi Marc. This has appeared on the list before. The reason is that myvar + 555 isn't actually an "expression" because the + operator is left-associative (works left to right). A java compiler will parse this as though it were: ( ( (500) + myvar ) + 555 ) so myvar + 555 is only ever seen as part of a bigger expression.
You will be able to introduce field on [myvar], [500 + myvar] or on the whole expression. HTH, Dan > -----Original Message----- > From: Wangjammer5 [mailto:[EMAIL PROTECTED]] > Sent: 04 January 2002 14:19 > To: [EMAIL PROTECTED] > Subject: [Eap-list] "Bug" in Introduce Field/Variable > > > > Hi, > > In Build #535 I've noticed that you can't introduce a field > or variable > on part of an expression. I don't know if this is a bug or > "limitation" > but see the following: > > int myvar = 1; > int another = 500 + myvar + 555; > > If you select "myvar + 555" and try Introduce Field / Variable it > complains that it is not an expression even though it is - > although not > the whole expression. > > If you add parens: > > int myvar = 1; > int another = 500 + (myvar + 555); > > And select "(myvar + 555)" it will let you do it. > > Cheers > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ W<A> ~~~~~ > (o) Wangjammer5 (Marc Palmer) > ( ) Wangjammer7 > > www.wangjammers.org = Java Consultants (Web|Smartcards|Crypto) > > > > _______________________________________________ > Eap-list mailing list > [EMAIL PROTECTED] > http://www.intellij.com/mailman/listinfo/eap-list > *************************************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify [EMAIL PROTECTED] immediately. This footnote also confirms that this email message has been swept for the presence of computer viruses. *************************************************************************************** _______________________________________________ Eap-list mailing list [EMAIL PROTECTED] http://www.intellij.com/mailman/listinfo/eap-list
