@@ -94,48 +94,48 @@ private Set<Long> getSourcesToPropagate(Node from) {
9494 // This function accumulates unclosed bubble sources from a mapping of incoming edge ids.
9595 Set <Long > propagatedSources = new HashSet <>();
9696 for (Relationship in : ins ) {
97- propagatedSources .addAll (relIDtoSourceIDs .remove (in .getId ()).stream ()
97+ propagatedSources .addAll (relIDtoSourceIDs .remove (Long . valueOf ( in .getId () )).stream ()
9898 .filter (source -> bubbleSourceIDtoEndIDs .get (source ) != null )
9999 .collect (Collectors .toList ()));
100100 }
101101 return propagatedSources ;
102102 }
103103
104- private void advanceEnds (long bubbleSource , Node endnode ) {
104+ private void advanceEnds (Long bubbleSource , Node endnode ) {
105105 Set <Long > pathEndIDs = bubbleSourceIDtoEndIDs .get (bubbleSource );
106106 if (pathEndIDs != null ) {
107- pathEndIDs .remove (endnode .getId ());
107+ pathEndIDs .remove (Long . valueOf ( endnode .getId () ));
108108
109109 // FIXME: we add twice here in most cases.
110110 endnode .getRelationships (RelTypes .NEXT , Direction .OUTGOING )
111- .forEach (rel -> pathEndIDs .add (rel .getEndNode ().getId ()));
111+ .forEach (rel -> pathEndIDs .add (Long . valueOf ( rel .getEndNode ().getId () )));
112112 }
113113 }
114114
115115 private void createBubbleSource (Node n , Set <Long > toPropagate ) {
116116 int outDegree = n .getDegree (RelTypes .NEXT , Direction .OUTGOING );
117117 if (outDegree >= 2 ) {
118118 Set <Long > pathEnds = new HashSet <>(outDegree );
119- toPropagate .add (n .getId ());
119+ toPropagate .add (Long . valueOf ( n .getId () ));
120120
121121 n .addLabel (NodeLabels .BUBBLE_SOURCE );
122122 n .getRelationships (RelTypes .NEXT , Direction .OUTGOING )
123- .forEach (rel -> pathEnds .add (rel .getEndNode ().getId ()));
123+ .forEach (rel -> pathEnds .add (Long . valueOf ( rel .getEndNode ().getId () )));
124124
125- bubbleSourceIDtoEndIDs .put (n .getId (), pathEnds );
125+ bubbleSourceIDtoEndIDs .put (Long . valueOf ( n .getId () ), pathEnds );
126126 }
127127 }
128128
129129 private void propagateSourceIDs (Set <Long > propagatedUnique , Relationship out ) {
130- relIDtoSourceIDs .put (out .getId (), propagatedUnique );
130+ relIDtoSourceIDs .put (Long . valueOf ( out .getId () ), propagatedUnique );
131131 }
132132
133133 private void createBubbleSink (Node n ) {
134134 int degree = n .getDegree (RelTypes .NEXT , Direction .INCOMING );
135135 if (degree >= 2 ) {
136136 Set <Long > bubbleSourceID = new HashSet <>();
137137 for (Relationship in : n .getRelationships (RelTypes .NEXT , Direction .INCOMING )) {
138- for (long sourceID : relIDtoSourceIDs .get (in .getId ())) {
138+ for (Long sourceID : relIDtoSourceIDs .get (Long . valueOf ( in .getId () ))) {
139139 if (bubbleSourceIDtoEndIDs .get (sourceID ).size () == 1 ) {
140140 bubbleSourceID .add (sourceID );
141141 }
@@ -145,13 +145,9 @@ private void createBubbleSink(Node n) {
145145 if (bubbleSourceIDtoEndIDs .get (id ).size () == 1 ) {
146146 bubbleSourceIDtoEndIDs .remove (id );
147147 }
148- Node bubbleSource = n .getGraphDatabase ().getNodeById (id );
149- n .createRelationshipTo (bubbleSource , RelTypes .BUBBLE_SINK_OF );
148+ Node bubbleSource = n .getGraphDatabase ().getNodeById (id .longValue ());
150149 bubbleSource .createRelationshipTo (n , RelTypes .BUBBLE_SOURCE_OF );
151150 });
152- if (bubbleSourceID .size () != 0 ) {
153- n .addLabel (NodeLabels .BUBBLE_SINK );
154- }
155151 }
156152 }
157153
0 commit comments