Java Mailing List Archive

http://www.gg3721.com/

Home » user.groovy »

[groovy-user] Variable exists

Eric Tetz

2008-08-21

Replies: Find Java Web Hosting

Author LoginPost Reply
Sorry from what I'm sure is a FAQ (I checked the FAQ and tried to
search the mailing list archives first; no luck),

How do I test for a variable being defined? I tried the obvious:

if (foo == null)
foo = new Foo()

But Groovy barfs on this, complaining that 'foo' is not a property of
my anonymous script object.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


©2008 gg3721.com - Jax Systems, LLC, U.S.A.