You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/03/04 15:31:00 UTC

[jira] [Commented] (TINKERPOP-2705) Support null as an argument where it makes sense in Gremlin.NET

    [ https://issues.apache.org/jira/browse/TINKERPOP-2705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17501386#comment-17501386 ] 

ASF GitHub Bot commented on TINKERPOP-2705:
-------------------------------------------

FlorianHockmann opened a new pull request #1580:
URL: https://github.com/apache/tinkerpop/pull/1580


   https://issues.apache.org/jira/browse/TINKERPOP-2705
   
   Changes made:
   * `GraphTraversal`/`GraphTraversalSource`: Ensure that no `NullReferenceException` gets thrown. Either allow `null` as an argument or throw an `ArgumentNullException` if it doesn't seem sensible and if Java also doesn't allow `null`.
   * `__`: Simply forward all `null` arguments to the steps in `GraphTraversal` so they can be handled there and we don't need to duplicate the logic whether we want to allow `null` or throw.
   
   I had to adapt the `DotNetTranslator` a bit as the logic to avoid problems where multiple overloads would be possible was to eager. This resulted in a `params object[]` argument that should be set to `null` for a scenario, being actually tested with an `object[]` which had `null` as an element. This let the scenarios pass although users would get a `NullReferenceException` since they probably won't add the unnecessary `object` cast.
   Example:
   `HasKey('name', null)` -> threw a `NullReferenceException`
   `HasKey('name', (object) null)` -> passed
   
   VOTE +1


-- 
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: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Support null as an argument where it makes sense in Gremlin.NET
> ---------------------------------------------------------------
>
>                 Key: TINKERPOP-2705
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2705
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: dotnet
>    Affects Versions: 3.5.2
>            Reporter: Florian Hockmann
>            Assignee: Florian Hockmann
>            Priority: Minor
>
> We improved support for {{null}} in the last few releases, but Gremlin.NET still throws a {{NullReferenceExceptions}} if {{null}} is provided in some places, especially when it's not obvious that {{null}} is a valid argument value.
> We should find these places and then either allow {{null}} there or throw an {{ArgumentNullException}} if we're really sure that {{null}} cannot be a valid argument there. In places where we don't know for sure whether {{null}} is always invalid or not, we should probably allow it in Gremlin.NET so that the server can decide how to handle it.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)