Hello,

Can you provide a CyclicPathTest that demonstrates the failure?

Marko.


> On Jun 13, 2017, at 10:34 AM, pieter gmail <[email protected]> wrote:
> 
> Hi,
> 
> With 3.2.5 CyclicPathStep and SimplePathStep has been replaced with 
> PathFilterStep.
> This is fine but whilst doing the refactor I noticed what appears to be a bug 
> in TraversalHelper.anyStepRecursively
> 
>    public static boolean anyStepRecursively(final Predicate<Step> predicate, 
> final Traversal.Admin<?, ?> traversal) {
>        for (final Step<?, ?> step : traversal.getSteps()) {
>            if (predicate.test(step)) {
>                return true;
>            }
> 
>            if (step instanceof TraversalParent) anyStepRecursively(predicate, 
> ((TraversalParent) step));
>        }
>        return false;
>    }
> 
> Surely the second if statement should return true if 
> anyStepRecursively(predicate, ((TraversalParent) step)); returns true?
> i.e.
> 
>    public static boolean anyStepRecursively(final Predicate<Step> predicate, 
> final Traversal.Admin<?, ?> traversal) {
>        for (final Step<?, ?> step : traversal.getSteps()) {
>            if (predicate.test(step)) {
>                return true;
>            }
> 
>            if (step instanceof TraversalParent) {
>                if (anyStepRecursively(predicate, ((TraversalParent) step))) {
>                    return true;
>                }
>            }
>        }
>        return false;
>    }
> 
> Cheers
> Pieter
> 
> 

Reply via email to