-
Notifications
You must be signed in to change notification settings - Fork 1.8k
AVRO-2883: Fix namespace mapping #1610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
6326ee3
1187cf8
c434957
e3c2804
ec47628
916c63f
a131791
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,14 +57,6 @@ public class CodeGen | |
| /// </value> | ||
| public IList<Protocol> Protocols { get; private set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets mapping of Avro namespaces to C# namespaces. | ||
| /// </summary> | ||
| /// <value> | ||
| /// The namespace mapping. | ||
| /// </value> | ||
| public IDictionary<string, string> NamespaceMapping { get; private set; } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this potentially API breaking to remove this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is a good call out. I reshuffled the code and added back the NamespaceMapping property and marked it obsolete. |
||
|
|
||
| /// <summary> | ||
| /// Gets list of generated namespaces. | ||
| /// </summary> | ||
|
|
@@ -80,7 +72,6 @@ public CodeGen() | |
| { | ||
| Schemas = new List<Schema>(); | ||
| Protocols = new List<Protocol>(); | ||
| NamespaceMapping = new Dictionary<string, string>(); | ||
| NamespaceLookup = new Dictionary<string, CodeNamespace>(StringComparer.Ordinal); | ||
| } | ||
|
|
||
|
|
@@ -129,9 +120,7 @@ protected virtual CodeNamespace AddNamespace(string name) | |
|
|
||
| if (!NamespaceLookup.TryGetValue(name, out CodeNamespace ns)) | ||
| { | ||
| ns = NamespaceMapping.TryGetValue(name, out string csharpNamespace) | ||
| ? new CodeNamespace(csharpNamespace) | ||
| : new CodeNamespace(CodeGenUtil.Instance.Mangle(name)); | ||
| ns = new CodeNamespace(CodeGenUtil.Instance.Mangle(name)); | ||
|
|
||
| foreach (CodeNamespaceImport nci in CodeGenUtil.Instance.NamespaceImports) | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not C# developer but this change does not look related to the issue with the namespaces by avrogen.
Please explain.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It is not related. I just got a watning that those packages are not used. All the reflection related code is in the main library. I guess there used to be code in avrogen which used relection, however it is not present. I can move it to a seperate ticket easily if needed. I considered this change just like removing unused
using WhateverPackage;There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw when I do sneaky stuff like this, usually create a specific commit for it and explain somewaht in the commit mnessage. 6326ee3