[GitHub] tinkerpop issue #381: TINKERPOP-1405 - profile() doesn't like withPath()

2016-08-16 Thread twilmes
Github user twilmes commented on the issue:

https://github.com/apache/tinkerpop/pull/381
  
Good suggestions Daniel.  I pushed the cleaned up code.  Tests were good on 
my side but I'll wait for Travis to finish up and merge if all is good.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] tinkerpop issue #381: TINKERPOP-1405 - profile() doesn't like withPath()

2016-08-16 Thread dkuppitz
Github user dkuppitz commented on the issue:

https://github.com/apache/tinkerpop/pull/381
  
Lots of calls to ` traversal.asAdmin().getEndStep()`. Maybe it's smarter to 
call it only once..? More like this:

```
// 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.
Step endStep;
if (TraversalHelper.hasStepOfClass(ProfileSideEffectStep.class, traversal) 
&&
        !((endStep = traversal.asAdmin().getEndStep()) instanceof 
ProfileSideEffectStep ||
                (endStep instanceof SideEffectCapStep && 
endStep.getPreviousStep() instanceof ProfileSideEffectStep) ||
                (endStep instanceof RequirementsStep && (
                        endStep.getPreviousStep() instanceof 
SideEffectCapStep ||
                        endStep.getPreviousStep() instanceof 
ProfileSideEffectStep {
    throw new VerificationException("When specified, the profile()-Step 
must be the last step or followed only by the cap()-step and/or requirements 
step.", traversal);
}
```

^ I also removed all the negations, which makes the chained conditions a 
bit easier to read IMO.

But all in all this PR looks good to me.

VOTE: +1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] tinkerpop issue #381: TINKERPOP-1405 - profile() doesn't like withPath()

2016-08-16 Thread okram
Github user okram commented on the issue:

https://github.com/apache/tinkerpop/pull/381
  
Nice find. I really do hate `RequirementsStep`.

VOTE +1.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---