From 4003ec32fcf6879b99729ffdfb4f7aa15ad56307 Mon Sep 17 00:00:00 2001 From: Matt Howlett Date: Fri, 19 Jan 2018 10:01:21 -0800 Subject: [PATCH] avrogen.exe: prevent clashes with namespaces that include Avro. --- lang/csharp/src/apache/main/CodeGen/CodeGen.cs | 2 +- lang/csharp/src/apache/main/CodeGen/CodeGenUtil.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/csharp/src/apache/main/CodeGen/CodeGen.cs b/lang/csharp/src/apache/main/CodeGen/CodeGen.cs index 7e70a02d50e..53d5b5367c9 100644 --- a/lang/csharp/src/apache/main/CodeGen/CodeGen.cs +++ b/lang/csharp/src/apache/main/CodeGen/CodeGen.cs @@ -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); diff --git a/lang/csharp/src/apache/main/CodeGen/CodeGenUtil.cs b/lang/csharp/src/apache/main/CodeGen/CodeGenUtil.cs index 68b83d83df3..227f7963b3e 100644 --- a/lang/csharp/src/apache/main/CodeGen/CodeGenUtil.cs +++ b/lang/csharp/src/apache/main/CodeGen/CodeGenUtil.cs @@ -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( @"------------------------------------------------------------------------------