[ 
https://issues.apache.org/jira/browse/TINKERPOP-1869?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16452264#comment-16452264
 ] 

ASF GitHub Bot commented on TINKERPOP-1869:
-------------------------------------------

Github user spmallette commented on a diff in the pull request:

    https://github.com/apache/tinkerpop/pull/857#discussion_r184062120
  
    --- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
 ---
    @@ -63,15 +64,17 @@ public void apply(final Traversal.Admin<?, ?> 
traversal) {
                     throw new VerificationException("The parent of a reducing 
barrier can not be repeat()-step: " + step, traversal);
             }
     
    -        // The ProfileSideEffectStep must be the last step, 2nd last step 
when accompanied by the cap step,
    -        // or 3rd to last when the traversal ends with a RequirementsStep.
    +        // The ProfileSideEffectStep must be one of the following
    +        // (1) the last step
    +        // (2) 2nd last step when accompanied by the cap step or none step 
(i.e. iterate() to nothing)
    +        // (3) 3rd to last when the traversal ends with a RequirementsStep.
             final Step<?, ?> endStep = traversal.asAdmin().getEndStep();
             if (TraversalHelper.hasStepOfClass(ProfileSideEffectStep.class, 
traversal) &&
                     !(endStep instanceof ProfileSideEffectStep ||
                             (endStep instanceof SideEffectCapStep && 
endStep.getPreviousStep() instanceof ProfileSideEffectStep) ||
    -                        (endStep instanceof RequirementsStep && (
    -                                endStep.getPreviousStep() instanceof 
SideEffectCapStep ||
    -                                        endStep.getPreviousStep() 
instanceof ProfileSideEffectStep)))) {
    +                        (endStep instanceof NoneStep && 
endStep.getPreviousStep() instanceof SideEffectCapStep && 
endStep.getPreviousStep().getPreviousStep() instanceof ProfileSideEffectStep) ||
    --- End diff --
    
    yeah - @dkuppitz is thinking about this kind of stuff. i had ideas too, but 
figured it was something for a different issue. Generally speaking, I think 
that if we want to do something about the complexity of strategy writing, we 
really need to carefully analyze the strategies that are out there and find 
good general functions to add that can be best used across all of them rather 
than looking at just a bad problem in one and build a function that only fits 
that case. 


> Profile step and iterate do not play nicely with each other
> -----------------------------------------------------------
>
>                 Key: TINKERPOP-1869
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1869
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.3.1
>            Reporter: Bryn Cooke
>            Assignee: stephen mallette
>            Priority: Minor
>
> Profile step doesn't like it if there are any other steps after it. However 
> if someone calls profile().iterate() they will get an error as iterate 
> appends a NoneStep to the end of the traversal.
> Even though this means that the results of the profile would never be 
> returned I think that profile step should allow None step to follow it.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to