Marko A. Rodriguez created TINKERPOP-1527:
---------------------------------------------
Summary: Do not override registered strategies in
TraversalStrategies.GlobalCache
Key: TINKERPOP-1527
URL: https://issues.apache.org/jira/browse/TINKERPOP-1527
Project: TinkerPop
Issue Type: Improvement
Components: process
Affects Versions: 3.2.3
Reporter: Marko A. Rodriguez
This may be a non-issue (need to check), but we currently do this in every
{{Graph}} (and {{GraphComputer}}) class.
{code}
static {
TraversalStrategies.GlobalCache.registerStrategies(TinkerGraph.class,
TraversalStrategies.GlobalCache.getStrategies(Graph.class).clone().addStrategies(TinkerGraphStepStrategy.instance()));
}
{code}
If this static code is loaded every time a {{Graph}} instance is created, then
manually tweaked strategy registrations get overwritten. If this is the case,
then we should do:
{code}
static {
TraversalStrategies.GlobalCache.registerStrategiesIfNotPresent(TinkerGraph.class,TraversalStrategies.GlobalCache.getStrategies(Graph.class).clone().addStrategies(TinkerGraphStepStrategy.instance()));
}
{code}
That is, add a {{registerIfNotPresent()}} method.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)