neo4j-contrib / java-rest-binding

Java Bindings for the Neo4J Server REST API, providing an implementation of GraphDatabaseService
Other
120 stars 72 forks source link

value data can be null #2

Closed FaKod closed 12 years ago

FaKod commented 12 years ago

I've implemented a test version of a RestOldTraverWrapper to support the old traverser for neo4j-scala (typed traverser for Neo4j Server). In my tests the value for data can be null, if I use the builtin return filter "all". The data parameter is created in method parseFullPath of class RestPathParser. Seems that in the include-start-node-case not all fields ("start" or "end") are set.

Dont know if this is a valid patch, because I have a very special use case...

FaKod commented 12 years ago

WDYT?

jexp commented 12 years ago

But with data == null we get invalid rest-entities? How can they then be used later?

jexp commented 12 years ago

and why is data null when you use "all" ?

FaKod commented 12 years ago

Yes - you are right. I will try to setup a self contained test case and come back later.

FaKod commented 12 years ago

Its the CTor of RestRelationship that throws the exception (data is null). I created a gist with a main method that shows that error: https://gist.github.com/2710656

It works fine if I remove the line: rt.filter(Traversal.returnAll());

You have to use the matrix example (Neo is node 391)

Does this help?

jexp commented 12 years ago

fixed in RestPathParser, so if you clean up your OldTraverser PR I can merge it.

FaKod commented 12 years ago

I checked your patch (1.8-SNAPSHOT) and it works perfect for me. As far as I can see, there is no need for a null check of data anymore. Tanks a lot :-)

jexp commented 12 years ago

great, can you then redo your PR for the old-traverser so that I can merge it?

FaKod commented 12 years ago

Ahh OK, you want the old-traverser. I close this PR and send a new one (because I have to put class RestOldTraverserWrapper into neo4j-rest-graphdb. It is in neo4j-scala currently)