Skip to content

Commit b2b8156

Browse files
Fix the code example (#228)
1 parent 4c1c204 commit b2b8156

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/ROOT/pages/traversal-framework/traversal-framework-java-api.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,20 +357,20 @@ class MaxWeightPathExpander implements PathExpander<Double>
357357
}
358358
359359
@Override
360-
public Iterable<Relationship> expand( Path path, BranchState<Double> branchState )
360+
public ResourceIterable<Relationship> expand( Path path, BranchState<Double> branchState )
361361
{
362362
if (path.lastRelationship() != null) {
363363
branchState.setState( branchState.getState() + (double) path.lastRelationship().getProperty( "weight" ) );
364364
}
365365
366-
Iterable<Relationship> relationships = path.endNode().getRelationships( Direction.OUTGOING );
366+
ResourceIterable<Relationship> relationships = path.endNode().getRelationships( Direction.OUTGOING );
367367
ArrayList<Relationship> filtered = new ArrayList<>();
368368
for ( Relationship relationship : relationships ) {
369369
if ( branchState.getState() + (double) relationship.getProperty( "weight" ) <= maxWeight ) {
370370
filtered.add(relationship);
371371
}
372372
}
373-
return filtered;
373+
return Iterables.asResourceIterable(filtered);
374374
}
375375
376376
@Override

0 commit comments

Comments
 (0)