On Thursday 21 May 2009 09:06:16 Andrea Aime wrote:
> Hum, as far as I understand the id is considered private in javacc
> and the code is supposed to perform instanceof checks instead.
>  From what I can see in the code, SimpleNode.getType() is used in
> a couple of places as an alternative to an instanceof check against
> the parsed node. So, either of the following could work:
> - really do perform instanceof checks in the code instead of relying
>    on getType
I have done an experiment with this option. I change the mode to MULTI so the 
jjtree the node for all cql statement. This solution requires to change all 
getType by if node instanceof ...
It require a lot of changes but it work.   

> - implement a int getType(Node) utility method that does the instanceof
>    needed and returns the type of the node
> As a further alternative, you can use reflection to force your way into
> the id field (you can access private fields by forcing their Field
> visibility to true at runtime), this would only work in an enviroment
> where the security manager is not set (or allowing that kind of
> trickery). For more information on this topic:
> http://tutorials.jenkov.com/java-reflection/private-fields-and-methods.html
I think in this possibility, it is a rapid solution but maybe it could produce 
us some problem in the future.

Well, today I will wait a reply from javacc (Factory node solution) if I don't 
get any good reply I will apply the first solution (node instanceof using Multi 
mode)

thanks for your feedback
-- 
Mauricio Pazos
www.axios.es

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to