Java Mailing List Archive

http://www.gg3721.com/

Home » eclipse-plugin-dev.groovy »

[groovy-eclipse-plugin-dev] underlining unknown references in maps

Andrew Eisenberg

2009-12-15

Replies: Find Java Web Hosting

Author LoginPost Reply
Hi all,

I have a design question for everyone. I am trying to find out what
is the most appropriate way of going here.

When using groovy's special map accessors:

def myMap = [:]
myMap.key = "value"
print myMap.key

This will obviously print "value" to stdout, but the static analyzer
will underline both references to "key". In this particular case, it
wouldn't be too horrendously difficult to be able to infer that the
"key" references are valid and that they refer to a String. But, this
is a very, very simple case. Much more complex forms of this behavior
is used in DSLs, particularly grails in controller classes. And it is
essentially an undecidable problem and at best it is very resource
intensive.

So, my question is this. I can see three ways of proceeding:

1. Do nothing and keep behavior as is. This will cause lots of
underlining when using maps.
2. Assume all map references are valid. This will mean no
underlining, but also no notification of invalid references.
3. Do the simple analysis as above, and assume all else is invalid.
This may cause some confusion since some valid map references will be
seen as valid, but others will not.

Any thoughts or suggestions? Any other ways to proceed?

--a

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

  http://xircles.codehaus.org/manage_email


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