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

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

FlorianHockmann commented on code in PR #1867:
URL: https://github.com/apache/tinkerpop/pull/1867#discussion_r1024892984


##########
gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs:
##########
@@ -96,15 +99,15 @@ private GraphTraversal(ICollection<ITraversalStrategy> 
traversalStrategies, Byte
         /// <summary>
         ///     Adds the E step to this <see cref="GraphTraversal{SType, 
EType}" />.
         /// </summary>
-        public GraphTraversal<TStart, Edge> E (params object[] 
edgeIdsOrElements)
+        public GraphTraversal<TStart, Edge> E (params object?[]? 
edgeIdsOrElements)
         {
             if (edgeIdsOrElements == null)
             {
-                Bytecode.AddStep("E", new object[] { null });
+                Bytecode.AddStep("E", new object?[] { null });
             }
             else
             {
-                var args = new List<object>(edgeIdsOrElements.Length);
+                var args = new List<object?>(edgeIdsOrElements.Length);

Review Comment:
   This file was originally generated automatically by some Groovy script that 
created basically one C# implementation of every Java implementation of a 
Gremlin step. It simply created a new list for all arguments so it could add 
all arguments to that list and then pass the list to `Bytecode.AddStep()`.
   Now that we no longer generate this code automatically, we could of course 
improve / optimize it by hand and remove these unnecessary creation of lists 
for example. However I think that should be done in a separate PR.





> Enable nullable checks
> ----------------------
>
>                 Key: TINKERPOP-2348
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2348
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: dotnet
>    Affects Versions: 3.4.11
>            Reporter: Florian Hockmann
>            Assignee: Florian Hockmann
>            Priority: Minor
>
> Gremlin.NET should enable [nullable 
> checks|https://devblogs.microsoft.com/dotnet/embracing-nullable-reference-types/]
>  to clearly communicate to users what can be {{null}} in Gremlin.NET and also 
> to possibly find possible {{NullReferenceExceptions}} easier in our own code.
> The recommendation from Microsoft is to update libraries during the so-called 
> _"nullable rollout phase"_ which ends in November with the expected release 
> of .NET 5 which should have nullable checks enabled by default.
> We can add .NET Core 3.1 as an additional target framework to get the 
> nullable checks and still also target .NET Standard to stay platform 
> independent and to also still support .NET Framework and older .NET Core 
> versions.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to