Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

avrogen.exe: prevent clashes with namespaces that include Avro. #1

Merged
merged 1 commit into from
Jan 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lang/csharp/src/apache/main/CodeGen/CodeGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ protected virtual void createSchemaField(Schema schema, CodeTypeDeclaration ctd,
// create function call Schema.Parse(json)
var cpe = new CodePrimitiveExpression(schema.ToString());
var cmie = new CodeMethodInvokeExpression(
new CodeMethodReferenceExpression(new CodeTypeReferenceExpression(typeof(Schema)), "Parse"),
new CodeMethodReferenceExpression(new CodeTypeReferenceExpression("Schema"), "Parse"),
new CodeExpression[] { cpe });
codeField.InitExpression = cmie;
ctd.Members.Add(codeField);
Expand Down
4 changes: 2 additions & 2 deletions lang/csharp/src/apache/main/CodeGen/CodeGenUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ private CodeGenUtil()
new CodeNamespaceImport("System"),
new CodeNamespaceImport("System.Collections.Generic"),
new CodeNamespaceImport("System.Text"),
new CodeNamespaceImport("Avro"),
new CodeNamespaceImport("Avro.Specific") };
new CodeNamespaceImport("global::Avro"),
new CodeNamespaceImport("global::Avro.Specific") };

FileComment = new CodeCommentStatement(
@"------------------------------------------------------------------------------
Expand Down