On Thursday 21 May 2009 15:00:51 Mauricio Pazos wrote: > 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.ht > >ml > > 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 Is there any problem to update javacc to 4.2? The reason why I need that is comment in
http://jira.codehaus.org/browse/GEOT-2510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment- tabpanel&focusedCommentId=178963#action_178963 cheers -- Mauricio Pazos www.axios.es ------------------------------------------------------------------------------ OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get _______________________________________________ Geotools-devel mailing list Geotools-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel