You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by va...@apache.org on 2024/05/17 21:03:07 UTC

(tinkerpop) branch valentyn/dotnet-build-fix created (now 5e8aafd5c2)

This is an automated email from the ASF dual-hosted git repository.

valentyn pushed a change to branch valentyn/dotnet-build-fix
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


      at 5e8aafd5c2 fix nullability checks

This branch includes the following new commits:

     new 5e8aafd5c2 fix nullability checks

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(tinkerpop) 01/01: fix nullability checks

Posted by va...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

valentyn pushed a commit to branch valentyn/dotnet-build-fix
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 5e8aafd5c241fd53b2b2b194335aecf63e6f16b5
Author: Valentyn Kahamlyk <Va...@improving.com>
AuthorDate: Fri May 17 14:02:54 2024 -0700

    fix nullability checks
---
 .../Structure/IO/GraphSON/EdgeDeserializer.cs            | 16 ++++++++--------
 .../Structure/IO/GraphSON/PropertyDeserializer.cs        |  2 +-
 .../Structure/IO/GraphSON/VertexDeserializer.cs          |  6 +++---
 .../Structure/IO/GraphSON/VertexPropertyDeserializer.cs  |  4 ++--
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/EdgeDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/EdgeDeserializer.cs
index 758b1f8957..4ab5ecdc2d 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/EdgeDeserializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/EdgeDeserializer.cs
@@ -31,26 +31,26 @@ namespace Gremlin.Net.Structure.IO.GraphSON
         public dynamic Objectify(JsonElement graphsonObject, GraphSONReader reader)
         {
             var outVId = reader.ToObject(graphsonObject.GetProperty("outV"));
-            var outVLabel = graphsonObject.TryGetProperty("outVLabel", out var outVLabelProperty)
-                ? outVLabelProperty.GetString()
+            string outVLabel = graphsonObject.TryGetProperty("outVLabel", out var outVLabelProperty)
+                ? outVLabelProperty.GetString()!
                 : Vertex.DefaultLabel;
             var outV = new Vertex(outVId, outVLabel);
             var inVId = reader.ToObject(graphsonObject.GetProperty("inV"));
-            var inVLabel = graphsonObject.TryGetProperty("inVLabel", out var inVLabelProperty)
-                ? inVLabelProperty.GetString()
+            string inVLabel = graphsonObject.TryGetProperty("inVLabel", out var inVLabelProperty)
+                ? inVLabelProperty.GetString()!
                 : Vertex.DefaultLabel;
             var inV = new Vertex(inVId, inVLabel);
             var edgeId = reader.ToObject(graphsonObject.GetProperty("id"));
-            var edgeLabel = graphsonObject.TryGetProperty("label", out var labelProperty)
-                ? labelProperty.GetString()
+            string edgeLabel = graphsonObject.TryGetProperty("label", out var labelProperty)
+                ? labelProperty.GetString()!
                 : "edge";
 
-            dynamic?[]? properties = null;
+            dynamic[]? properties = null;
             if (graphsonObject.TryGetProperty("properties", out var propertiesObject)
                 && propertiesObject.ValueKind == JsonValueKind.Object)
             {
                 properties = propertiesObject.EnumerateObject()
-                    .Select(p => reader.ToObject(p.Value)).ToArray();
+                    .Select(p => reader.ToObject(p.Value)!).ToArray();
             }
 
             return new Edge(edgeId, outV, edgeLabel, inV, properties);
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/PropertyDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/PropertyDeserializer.cs
index 7c9ea0c34c..942c0092f3 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/PropertyDeserializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/PropertyDeserializer.cs
@@ -29,7 +29,7 @@ namespace Gremlin.Net.Structure.IO.GraphSON
     {
         public dynamic Objectify(JsonElement graphsonObject, GraphSONReader reader)
         {
-            var key = graphsonObject.GetProperty("key").GetString();
+            string key = graphsonObject.GetProperty("key").GetString()!;
             var value = reader.ToObject(graphsonObject.GetProperty("value"));
             var element = graphsonObject.TryGetProperty("element", out var elementProperty)
                 ? reader.ToObject(elementProperty)
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexDeserializer.cs
index 959021859c..2412c9a27b 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexDeserializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexDeserializer.cs
@@ -32,11 +32,11 @@ namespace Gremlin.Net.Structure.IO.GraphSON
         public dynamic Objectify(JsonElement graphsonObject, GraphSONReader reader)
         {
             var id = reader.ToObject(graphsonObject.GetProperty("id"));
-            var label = graphsonObject.TryGetProperty("label", out var labelProperty)
-                ? labelProperty.GetString()
+            string label = graphsonObject.TryGetProperty("label", out var labelProperty)
+                ? labelProperty.GetString()!
                 : Vertex.DefaultLabel;
 
-            dynamic?[]? properties = null;
+            dynamic[]? properties = null;
             if (graphsonObject.TryGetProperty("properties", out var propertiesObject)
                 && propertiesObject.ValueKind == JsonValueKind.Object)
             {
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexPropertyDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexPropertyDeserializer.cs
index b204185453..e8e919bee4 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexPropertyDeserializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexPropertyDeserializer.cs
@@ -31,13 +31,13 @@ namespace Gremlin.Net.Structure.IO.GraphSON
         public dynamic Objectify(JsonElement graphsonObject, GraphSONReader reader)
         {
             var id = reader.ToObject(graphsonObject.GetProperty("id"));
-            var label = graphsonObject.GetProperty("label").GetString();
+            string label = graphsonObject.GetProperty("label").GetString()!;
             var value = reader.ToObject(graphsonObject.GetProperty("value"));
             var vertex = graphsonObject.TryGetProperty("vertex", out var vertexProperty)
                 ? new Vertex(reader.ToObject(vertexProperty))
                 : null;
 
-            dynamic?[]? properties = null;
+            Property[]? properties = null;
             if (graphsonObject.TryGetProperty("properties", out var propertiesObject)
                 && propertiesObject.ValueKind == JsonValueKind.Object)
             {