88
99import java .util .Collections ;
1010import java .util .List ;
11+ import java .util .Objects ;
1112import java .util .Optional ;
1213import java .util .stream .Collectors ;
1314import java .util .stream .Stream ;
@@ -35,7 +36,7 @@ public Stream<PathRecord> findOnePath(@Name("start") Node start, @Name("end") No
3536 PathExpanderBuilder .empty ()
3637 .add (RelationshipType .withName (relationType ), Direction .OUTGOING )
3738 // filter non delete relation
38- .addRelationshipFilter (relationship -> relationship .getProperty ("is_deleted" , "0" ). equals ( "0" )).build ())
39+ .addRelationshipFilter (relationship -> Objects . equals ( relationship .getProperty ("is_deleted" , 0 ), 0 )).build ())
3940 .uniqueness (Uniqueness .NODE_GLOBAL )
4041 .traverse (start );
4142
@@ -46,7 +47,7 @@ public Stream<PathRecord> findOnePath(@Name("start") Node start, @Name("end") No
4647 @ Description ("find one path from start to end between minlength and maxlength, also show first multi dispatch" )
4748 public Stream <PathRecord > biFindOnePath (@ Name ("start" ) Node start , @ Name ("end" ) Node end , @ Name ("maxLength" ) long maxLength , @ Name (value = "relationshipType" , defaultValue = "Call" ) String relationType , @ Name (value = "callProperty" , defaultValue = "insn" ) String callProperty ){
4849 TraversalDescription base = tx .traversalDescription ().depthFirst ().uniqueness (Uniqueness .RELATIONSHIP_GLOBAL );
49- PathExpander expander = PathExpanderBuilder .empty ().add (RelationshipType .withName (relationType ), Direction .OUTGOING ).addRelationshipFilter (relationship -> relationship .getProperty ("is_deleted" , "0" ). equals ( "0" )).build ();
50+ PathExpander expander = PathExpanderBuilder .empty ().add (RelationshipType .withName (relationType ), Direction .OUTGOING ).addRelationshipFilter (relationship -> Objects . equals ( relationship .getProperty ("is_deleted" , 0 ), 0 )).build ();
5051 int maxDepth = (int ) maxLength ;
5152
5253 final Traverser traverser = tx .bidirectionalTraversalDescription ()
@@ -94,7 +95,7 @@ public List<Relationship> getFirstMultiDispatch(Path path, String callProperty){
9495 }
9596 Object property = relationship .getProperty (callProperty );
9697 List <Relationship > relationships = startNode .getRelationships (relationship .getType ()).stream ().filter (
97- relation ->relation .hasProperty (callProperty ) && relation .getProperty (callProperty ).equals (property )
98+ relation ->relation .hasProperty (callProperty ) && relation .getProperty (callProperty ).equals (property ) && ! Objects . equals ( relation . getProperty ( "is_deleted" , 0 ), 0 )
9899 ).collect (Collectors .toList ());
99100
100101 if (relationships .size () > 1 ){
0 commit comments