[
https://issues.apache.org/jira/browse/TINKERPOP-2824?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17689980#comment-17689980
]
ASF GitHub Bot commented on TINKERPOP-2824:
-------------------------------------------
vkagamlyk commented on code in PR #1843:
URL: https://github.com/apache/tinkerpop/pull/1843#discussion_r1109001720
##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/GremlinScriptChecker.java:
##########
@@ -34,15 +34,16 @@ public class GremlinScriptChecker {
/**
* An empty result whose properties return as empty.
*/
- public static final Result EMPTY_RESULT = new Result(null, null);
+ public static final Result EMPTY_RESULT = new Result(null, null, null);
/**
* At least one of these tokens should be present somewhere in the Gremlin
string for {@link #parse(String)} to
* take any action at all.
*/
+ // todo: why not used `Tokens`?
Review Comment:
There's a bit of a mess with names for this constants.
For example we have constant for
[evaluationTimeout](https://github.com/apache/tinkerpop/blob/master/gremlin-util/src/main/java/org/apache/tinkerpop/gremlin/util/Tokens.java#L78)
and can use `Token.ARGS_EVAL_TIMEOUT`, not plain string. Same for `requestId`,
but not for `scriptEvaluationTimeout`. Also `Tokens.ARGS_SCRIPT_EVAL_TIMEOUT`
is not defined and I don't understand why.
I think better to use constants when possible and this like can looks like
```
private static final Set<String> tokens = new
HashSet<>(Arrays.asList(Tokens.ARGS_EVAL_TIMEOUT,
Tokens.ARGS_SCRIPT_EVAL_TIMEOUT,
Tokens.REQUEST_ID,
Tokens.ARGS_MATERIALIZE_PROPERTIES));
```
but made in the same style as before.
> Properties on Elements
> ----------------------
>
> Key: TINKERPOP-2824
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2824
> Project: TinkerPop
> Issue Type: Improvement
> Components: dotnet, driver, go, javascript, process, python
> Affects Versions: 3.5.4
> Reporter: Valentyn Kahamlyk
> Assignee: Valentyn Kahamlyk
> Priority: Major
>
> Problem: When a user writes `g.V()` they get back a Vertex object. The
> problem is that depending on the execution context of the traversal, the
> result could be quite different, with or without properties.
> Solution: Implement new finalization strategy DetachStrategy(detachMode,
> properties) where mode is one of ALL, NONE or CUSTOM. `properties` is list of
> properties name, are taken into account only for CUSTOM mode.
> Discussion thread in dev list: [Proposal to handle properties on response
> Elements-Apache Mail
> Archives|https://lists.apache.org/thread/l8rw7ydj7kym8vhtwk50nhbp45ng9986]
> Stephen's thread in dev list: [The Issue of Detachment-Apache Mail
> Archives|https://lists.apache.org/thread/xltcon4zxnwq4fyw2r2126syyrqm8spy]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)