spmallette commented on a change in pull request #1533:
URL: https://github.com/apache/tinkerpop/pull/1533#discussion_r773419796
##########
File path:
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
##########
@@ -2364,14 +2365,57 @@ else if (value instanceof Traversal)
* @since 3.0.0-incubating
*/
public default GraphTraversal<S, E> property(final Object key, final
Object value, final Object... keyValues) {
- return key instanceof VertexProperty.Cardinality ?
- this.property((VertexProperty.Cardinality) key, value, null ==
keyValues ? null : keyValues[0],
+ if (key instanceof VertexProperty.Cardinality) {
+ if (value instanceof Map) { //Handle the property(Cardinality,
Map) signature
+ Map<Object, Object> map = (Map)value;
+ for (Map.Entry<Object, Object> entry : map.entrySet()) {
+ property(key, entry.getKey(), entry.getValue());
+ }
+ return this;
+ } else {
+ return this.property((VertexProperty.Cardinality) key, value,
null == keyValues ? null : keyValues[0],
keyValues != null && keyValues.length > 1 ?
Arrays.copyOfRange(keyValues, 1,
keyValues.length) :
- new Object[]{}) :
- this.property(null, key, value, keyValues);
+ new Object[]{});
+ }
+ } else { //handles if cardinality is not the first parameter
+ if (value instanceof Map) { //Handle the property(Cardinality,
Map) signature
+ Map<Object, Object> map = (Map)value;
Review comment:
please give a look to your local variable declarations in this PR - we
dont have many style rules but we like to prefer the use of the `final` keyword
where it can be used.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]