On Sat, 28 Feb 2009, Christian Heimes wrote:
Christian Heimes wrote:
Thanks Andi! Your proposed solution worked like a charm and the file
compiles. However the next file breaks with another error. This time it
didn't help to add "operator" to the list of RES
Follow up:
Apparently JCC doesn't check the list of RESERVED words when it creates
namespaces. I tried a quick fix but it's much more work than I thought.
Both cpp.py and python.py must be changed. Every #include, namespace and
class related line has to check for RESERVED and mangle the name if
necessary.
Hi Christian,
Thank you for sending in detailed instructions on how to reproduce this (in
an earlier message). I believe I now fixed the bug with Java packages or
classes named using C++ reserved words. As with methods or fields, a '$' is
added to the namespace or class name.
Along the way, I also fixed a long standing bug where static methods would
be shadowed in Python wrappers by non-static methods of the same name.
Now, when a Java class has static and non-static methods with the same name
the static methods are suffixed with '_' on the Python class. JCC emits a
warning to stderr when this occurs.
>>> Long.toString_(9L)
u'9'
>>> Long(9L).toString()
u'9'
After both these fixes, I was able to build wrappers for pdfbox:
>>> from pdfbox import *
>>> initVM(CLASSPATH, vmargs='-Djava.awt.headless=true')
<jcc.JCCEnv object at 0x295c0>
>>>
This is all checked into rev 751772.
Please let me know if this works for you, I'd like to get a PyLucene 2.4.1
release started now that Java Lucene 2.4.1 has been released. If I broke
something while doing these non-trivial fixes, now is the time to find out.
Thanks !
Andi..