What steps will reproduce the problem?
The following code will not work like one expects:
void recursion(HGHandle node) {
this.outgoingIncidentNodesQuery = make(HGHandle.class, graphDB)
.compile(
apply(
targetAt(graphDB, 1),
incidentAt(
var("sourceNode", HGHandle.class),
0)
)
);
for (HGHandle incident : outgoingIncidentNodesQuery.var("sourceNode",
node).execute) {
for (HGHandle incident : outgoingIncidentNodesQuery.var("sourceNode", someOtherNode).execute) {
// do something
}
}
Since VarContext stores its "locals" in a ThreadLocal, the second call to
outgoingIncidentNodesQuery.var() will override the variable globaly and the
Iterator of the outer loop will subsequently check for incidence to
"someOtherNode", not for incidence to "node", as it was constructed to do.
Original issue reported on code.google.com by google-a...@gehrels.info on 12 Feb 2013 at 5:23
Original issue reported on code.google.com by
google-a...@gehrels.info
on 12 Feb 2013 at 5:23