GitHub user okram opened a pull request:
https://github.com/apache/tinkerpop/pull/464
TINKERPOP-1527: Do not override registered strategies in
TraversalStrategies.GlobalCache
https://issues.apache.org/jira/browse/TINKERPOP-1527
`GraphComputer` strategy registration in `TraversalStrategy.GlobalCache`
has been a "uh..I think static{}-blocks load once and only once and when the
class is used?" ... This assumption lead to a few errant problems that have
been rectified and verified in this PR.
1.) `TraversalStrategies.GlobalCache` strategies can be manipulated without
fear of a new instance of the `Graph` or `GraphComputer` class over-writing
user manipulations. That is, a test case now proves that `static{}` loads once
and only once.
2.) `TraversalStrategies.GlobalCache.getStrategies()` is responsible for
ensuring that `static{}` has been called for the particular `Graph` or
`GraphComputer` class. A test case now proves that `Class.forName()` is
sufficient to accomplish this.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/tinkerpop TINKERPOP-1527
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/tinkerpop/pull/464.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #464
----
commit f9bf0444e4bfe09dcea9b8dc05870ddaec4b6180
Author: Marko A. Rodriguez <[email protected]>
Date: 2016-10-25T19:02:29Z
TraversalStrategy.GlobalCache.getStrategies() is now the point where
static{} code blocks are loaded for Graph and GraphComputer classes. Added a
test case to TraversalStrategiesTset that demonstrates that the GlobalCache can
be manipulated without fear of static{} re-registering strategies. This is a
much much safer model and, moreover, proved correct via testing.
commit b0bedf6b441edddbfd2e005641fee0a044b3b552
Author: Marko A. Rodriguez <[email protected]>
Date: 2016-10-25T19:07:01Z
added authorship to TraversalStrategies java file.
----
---
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 [email protected] or file a JIRA ticket
with INFRA.
---