| Author |
Another instanceof type question.
|
Mark Spritzler
ranger
Sheriff
Joined: Feb 05, 2001
Posts: 17225
|
posted

0
|
OK, I still need that other thread answered for one of my validations.
But for this other one here, It is different I am actually putting in String with instance of so (fieldValue instanceof String)
But what is odd, I have this if statement that is always returning as true, even when it should be false.
So that if is evaluating as true even when fieldValue is of type String. That part should be false.
Can't figure out what I am missing here.
Thanks
Mark
|
Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
|
 |
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15229
|
|
This works for me with Groovy 2.0.5
|
 |
Mark Spritzler
ranger
Sheriff
Joined: Feb 05, 2001
Posts: 17225
|
posted

0
|
Gregg Bolinger wrote:This works for me with Groovy 2.0.5
So that wouldn't print W00t because it is of type String. Which is what I want.
To get around this I have to break the if statement into two separate ones.
And then it works the way I wanted and expected. Thanks for the replies.
Mark
|
 |
 |
|
|
subject: Another instanceof type question.
|
|
|