[Neo] Issues with overloaded methods
thobes at gmail.com
Mon Apr 9 23:28:46 CEST 2007
On 4/9/07, Johan Svensson <johan at neopersistence.com> wrote:
> On 4/9/07, Tobias Ivarsson <thobes at gmail.com> wrote:
> > Hi!
> > I am working on a Python frontend for Neo4J, which I call Neo4J.py, that
> > can
> > be used with either Jython  or a Python (CPython ) extension
> > JPype .
> However I am experiencing some strange problems when using JPype. When I
> > to iterate over the result of a traverser I get an error message saying
> > that
> > JPype could not determine which, of more than one overloaded, next()
> > methods
> > it should choose. I have never had this problem with any other Iterator
> > Iterable and JPype before, so I am trying to figure out what could be
> > causing this behavior.
> > My current theory is that some where in the type hierarchy of the actual
> > implementation of the Traverser there are two (or more) classes that
> > implement the Iterable interface, which would mean that there are
> > next() methods.
> > Could anyone with access to the source please tell me whether this is
> > case or not. Or send me some sort of preview version of the source so
> > I
> > could investigate the matter on my own.
> In org.neo4j.impl.traversal package we have:
> public interface Traverser extends org.neo4j.api.core.Traverser
> abstract class AbstractTraverser implements Traverser,Iterator<Node>
Ah! this is probably the source of the problem. JPype implements ways of
iterating over both Iterator and Iterable via wrapping code. I am guessing
that since the Traverser Iterable is itself its own Iterator the object will
get wrapped twice which leads to the confusion. Now all I have to do is to
find a way to avoid that. Preferably without needing to patch neither JPype
class BreadthFirstTraverser extends AbstractTraverser
> class DepthFirstTraverser extends AbstractTraverser
> The first interface (Traverser that extends api.core.Traverser) is just
> stuff that hasn't been removed yet since the recent update of the Neo API.
> Implementation of Iterator interface lies in AbstractTraverser, the two
> concrete classes (that gets instantiated depending on
> BREADTH_FIRST/DEPTH_FIRST traverser) don't override any of the Iterator
> interface methods.
> I will submit a link to the source code of my project on this list as soon
> > as a have added some license notes to my files and perhaps written some
> > documentation.
> > best regards
> > Tobias Ivarsson
> >  http://www.jython.org/
> >  http://jpype.sourceforge.net/
> >  http://www.python.org/
> Great, as you probably already know we are waiting for the GPLv3 to be
> released before we release the source for Neo. If my description above
> wasn't enough I can send you the source code under a proprietary license.
> Neo mailing list
> User at lists.neo4j.org
More information about the User