Mauricio Pazos ha scritto:
> 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?

There is. The latest version of the javacc-maven-plugin uses
javacc 4.1, see:
http://mojo.codehaus.org/javacc-maven-plugin/dependencies.html

and the pom file of the latest version here:
http://repo1.maven.org/maven2/org/codehaus/mojo/javacc-maven-plugin/2.5/javacc-maven-plugin-2.5.pom

So we'd have to get involved with that plugin development and push usage 
of javacc 4.2, wait for a release, and so on. Seems similar effort to
keeping our javacc plugin around, thought it would benefit a wider audience.

You could also try opening a jira issue here:
http://jira.codehaus.org/browse/MJAVACC

Cheers
Andrea

-- 
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
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

Reply via email to