You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by mg...@apache.org on 2022/01/31 06:57:08 UTC
[avro] branch branch-1.11 updated: AVRO-3333 Updated to correct spacing styling issues (#1483)
This is an automated email from the ASF dual-hosted git repository.
mgrigorov pushed a commit to branch branch-1.11
in repository https://gitbox.apache.org/repos/asf/avro.git
The following commit(s) were added to refs/heads/branch-1.11 by this push:
new 76ccd2b AVRO-3333 Updated to correct spacing styling issues (#1483)
76ccd2b is described below
commit 76ccd2b7fd125da86df34f431ac2d9dd2364bbcb
Author: Kyle Schoonover <ky...@minmaxcorp.com>
AuthorDate: Sun Jan 30 22:56:14 2022 -0800
AVRO-3333 Updated to correct spacing styling issues (#1483)
Co-authored-by: Kyle T. Schoonover <Ky...@nordstrom.com>
(cherry picked from commit c88481400a70546e7c261ca939709a551c8b1d40)
---
lang/csharp/src/apache/main/CodeGen/CodeGen.cs | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/lang/csharp/src/apache/main/CodeGen/CodeGen.cs b/lang/csharp/src/apache/main/CodeGen/CodeGen.cs
index b282570..12e54ea 100644
--- a/lang/csharp/src/apache/main/CodeGen/CodeGen.cs
+++ b/lang/csharp/src/apache/main/CodeGen/CodeGen.cs
@@ -144,6 +144,7 @@ namespace Avro
CompileUnit.Namespaces.Add(ns);
NamespaceLookup.Add(name, ns);
}
+
return ns;
}
@@ -464,14 +465,13 @@ namespace Avro
property.Type = new CodeTypeReference("Avro.Protocol");
property.HasGet = true;
-
property.GetStatements.Add(new CodeTypeReferenceExpression("return protocol"));
ctd.Members.Add(property);
// var requestMethod = CreateRequestMethod();
// ctd.Members.Add(requestMethod);
-
var requestMethod = CreateRequestMethod();
+
// requestMethod.Attributes |= MemberAttributes.Override;
var builder = new StringBuilder();
@@ -495,6 +495,7 @@ namespace Avro
builder.Append("\t\t\t}");
}
+
var cseGet = new CodeSnippetExpression(builder.ToString());
requestMethod.Statements.Add(cseGet);
@@ -519,9 +520,6 @@ namespace Avro
ctd.BaseTypes.Add(protocolNameMangled);
// Need to override
-
-
-
AddProtocolDocumentation(protocol, ctd);
AddMethods(protocol, true, ctd);
@@ -553,6 +551,7 @@ namespace Avro
var callback = new CodeParameterDeclarationExpression(typeof(object), "callback");
requestMethod.Parameters.Add(callback);
}
+
return requestMethod;
}
@@ -615,7 +614,6 @@ namespace Avro
messageMember.Parameters.Add(parameter);
}
-
ctd.Members.Add(messageMember);
}
}
@@ -977,8 +975,8 @@ namespace Avro
{
return csharpType.ToString();
}
-
}
+
throw new CodeGenException("Unable to generate CodeTypeReference for " + schema.Name + " type " + schema.Tag);
}
@@ -1006,11 +1004,13 @@ namespace Avro
ret = childSchema;
}
}
+
if (!nullable)
{
ret = null;
}
}
+
return ret;
}
@@ -1028,6 +1028,7 @@ namespace Avro
string schemaFname = "_SCHEMA";
var codeField = new CodeMemberField(ctrfield, schemaFname);
codeField.Attributes = MemberAttributes.Public | MemberAttributes.Static;
+
// create function call Schema.Parse(json)
var cpe = new CodePrimitiveExpression(schema.ToString());
var cmie = new CodeMethodInvokeExpression(
@@ -1107,6 +1108,7 @@ namespace Avro
{
dir = Path.Combine(dir, name);
}
+
Directory.CreateDirectory(dir);
var new_ns = new CodeNamespace(ns.Name);