From 72ccbf8b829cf5d7c2aa1b95eaa0ea9c6bd8ab8c Mon Sep 17 00:00:00 2001 From: Kyle Schoonover Date: Wed, 13 Apr 2022 23:52:41 -0700 Subject: [PATCH] AVRO-3488 Fix spelling mistakes (#1642) * AVRO-3360 Updated XML documentation * Revert "AVRO-3360 Updated XML documentation" This reverts commit b8601c072a5083380d30b580804dd0908b8cf4cc. * Fix spelling mistakes * Fix spelling change Co-authored-by: Kyle T. Schoonover (cherry picked from commit 514e1c24f5a83901c4461efe3058dd0383b96a3f) --- lang/csharp/CodeAnalysis.src.globalconfig | 4 +-- lang/csharp/CodeAnalysis.test.globalconfig | 4 +-- .../src/apache/codegen/Avro.codegen.csproj | 2 +- lang/csharp/src/apache/codegen/AvroGen.cs | 2 +- .../src/apache/main/CodeGen/CodeGenUtil.cs | 2 +- .../src/apache/main/File/IFileReader.cs | 2 +- .../src/apache/main/Generic/GenericReader.cs | 32 +++++++++---------- .../src/apache/main/Generic/GenericWriter.cs | 18 +++++------ .../main/Generic/PreresolvingDatumReader.cs | 4 +-- .../main/Generic/PreresolvingDatumWriter.cs | 8 ++--- .../apache/main/IO/ByteBufferInputStream.cs | 2 +- lang/csharp/src/apache/main/IO/Decoder.cs | 2 +- lang/csharp/src/apache/main/IO/Encoder.cs | 2 +- .../main/Reflect/ArraySchemaExtensions.cs | 2 +- .../src/apache/main/Reflect/ClassCache.cs | 4 +-- .../src/apache/main/Reflect/DotnetClass.cs | 10 +++--- .../src/apache/main/Reflect/EnumCache.cs | 2 +- lang/csharp/src/apache/main/Reflect/README.md | 6 ++-- .../main/Reflect/ReflectDefaultReader.cs | 8 ++--- .../src/apache/main/Reflect/ReflectReader.cs | 4 +-- .../src/apache/main/Schema/JsonHelper.cs | 2 +- .../csharp/src/apache/main/Schema/Property.cs | 2 +- .../src/apache/main/Schema/RecordSchema.cs | 6 ++-- .../src/apache/main/Schema/SchemaName.cs | 2 +- .../apache/main/Schema/SchemaNormalization.cs | 6 ++-- .../src/apache/main/Schema/UnionSchema.cs | 2 +- .../apache/main/Specific/SpecificReader.cs | 8 ++--- .../src/apache/test/CodGen/CodeGenTest.cs | 2 +- lang/csharp/src/apache/test/File/FileTests.cs | 10 +++--- .../src/apache/test/IO/BinaryCodecTests.cs | 2 +- .../src/apache/test/Specific/SpecificTests.cs | 2 +- .../src/apache/test/Util/LogicalTypeTests.cs | 2 +- .../src/apache/test/Utils/VersionTests.cs | 6 ++-- lang/csharp/versions.props | 6 ++-- 34 files changed, 89 insertions(+), 89 deletions(-) diff --git a/lang/csharp/CodeAnalysis.src.globalconfig b/lang/csharp/CodeAnalysis.src.globalconfig index 98db3e944fb..2537599edcb 100644 --- a/lang/csharp/CodeAnalysis.src.globalconfig +++ b/lang/csharp/CodeAnalysis.src.globalconfig @@ -1128,7 +1128,7 @@ dotnet_diagnostic.SA1314.severity = none # SA1316: Tuple element names should use correct casing dotnet_diagnostic.SA1316.severity = none -# SA1400: Member should declare an access modifer +# SA1400: Member should declare an access modifier dotnet_diagnostic.SA1400.severity = warning # SA1401: Fields should be private @@ -1152,7 +1152,7 @@ dotnet_diagnostic.SA1407.severity = none # SA1408: Conditional expressions should declare precedence dotnet_diagnostic.SA1408.severity = none -# SA1410: Remove delegate parens when possible +# SA1410: Remove delegate parentheses when possible dotnet_diagnostic.SA1410.severity = warning # SA1411: Attribute constructor shouldn't use unnecessary parenthesis diff --git a/lang/csharp/CodeAnalysis.test.globalconfig b/lang/csharp/CodeAnalysis.test.globalconfig index f96d292db22..ffb541fa360 100644 --- a/lang/csharp/CodeAnalysis.test.globalconfig +++ b/lang/csharp/CodeAnalysis.test.globalconfig @@ -1125,7 +1125,7 @@ dotnet_diagnostic.SA1314.severity = none # SA1316: Tuple element names should use correct casing dotnet_diagnostic.SA1316.severity = none -# SA1400: Member should declare an access modifer +# SA1400: Member should declare an access modifier dotnet_diagnostic.SA1400.severity = none # SA1401: Fields should be private @@ -1149,7 +1149,7 @@ dotnet_diagnostic.SA1407.severity = none # SA1408: Conditional expressions should declare precedence dotnet_diagnostic.SA1408.severity = none -# SA1410: Remove delegate parens when possible +# SA1410: Remove delegate parentheses when possible dotnet_diagnostic.SA1410.severity = none # SA1411: Attribute constructor shouldn't use unnecessary parenthesis diff --git a/lang/csharp/src/apache/codegen/Avro.codegen.csproj b/lang/csharp/src/apache/codegen/Avro.codegen.csproj index ad49521fbfa..e0e2b8e68b3 100644 --- a/lang/csharp/src/apache/codegen/Avro.codegen.csproj +++ b/lang/csharp/src/apache/codegen/Avro.codegen.csproj @@ -22,7 +22,7 @@ Exe diff --git a/lang/csharp/src/apache/codegen/AvroGen.cs b/lang/csharp/src/apache/codegen/AvroGen.cs index 4b401a359ae..f1572c32f19 100644 --- a/lang/csharp/src/apache/codegen/AvroGen.cs +++ b/lang/csharp/src/apache/codegen/AvroGen.cs @@ -43,7 +43,7 @@ public static int Main(string[] args) if (args.Contains("--version") || args.Contains("-V")) { // Print version information - // Note: Use InformationalVersion attributre + // Note: Use InformationalVersion attribute // It is capable to include semver prerelease information label (if prerelease), e.g. 1.x.y-beta.z Console.WriteLine(typeof(AvroGenTool).Assembly.GetCustomAttribute().InformationalVersion); return 0; diff --git a/lang/csharp/src/apache/main/CodeGen/CodeGenUtil.cs b/lang/csharp/src/apache/main/CodeGen/CodeGenUtil.cs index 63399599866..1a720e16533 100644 --- a/lang/csharp/src/apache/main/CodeGen/CodeGenUtil.cs +++ b/lang/csharp/src/apache/main/CodeGen/CodeGenUtil.cs @@ -102,7 +102,7 @@ is regenerated // Visual Studio 2010 https://msdn.microsoft.com/en-us/library/x53a06bb.aspx // Note: // 1. Contextual keywords are not reserved keywords e.g. value, partial - // 2. __arglist, __makeref, __reftype, __refvalue are undocumented keywords, but recognised by the C# compiler + // 2. __arglist, __makeref, __reftype, __refvalue are undocumented keywords, but recognized by the C# compiler ReservedKeywords = new HashSet() { "abstract","as", "base", "bool", "break", "byte", "case", "catch", "char", "checked", "class", "const", "continue", "decimal", "default", "delegate", "do", "double", "else", "enum", "event", diff --git a/lang/csharp/src/apache/main/File/IFileReader.cs b/lang/csharp/src/apache/main/File/IFileReader.cs index a4defd2a1e3..c482f7752da 100644 --- a/lang/csharp/src/apache/main/File/IFileReader.cs +++ b/lang/csharp/src/apache/main/File/IFileReader.cs @@ -101,7 +101,7 @@ public interface IFileReader : IDisposable /// /// Position to test. /// - /// True if pasth the next synchronization point after , false + /// True if path the next synchronization point after , false /// otherwise. /// bool PastSync(long position); diff --git a/lang/csharp/src/apache/main/Generic/GenericReader.cs b/lang/csharp/src/apache/main/Generic/GenericReader.cs index 8c9e9678e75..05139f0fc05 100644 --- a/lang/csharp/src/apache/main/Generic/GenericReader.cs +++ b/lang/csharp/src/apache/main/Generic/GenericReader.cs @@ -75,7 +75,7 @@ public GenericReader(DefaultReader reader) /// Reads an object off the stream. /// /// - /// If not null, the implemenation will try to use to return the object + /// If not null, the implementation will try to use to return the object /// /// Decoder to read from. /// Object we read from the decoder. @@ -88,7 +88,7 @@ public T Read(T reuse, Decoder d) /// /// The default implementation for the generic reader. It constructs new .NET objects for avro objects on the /// stream and returns the .NET object. Users can directly use this class or, if they want to customize the - /// object types for differnt Avro schema types, can derive from this class. There are enough hooks in this + /// object types for different Avro schema types, can derive from this class. There are enough hooks in this /// class to allow customization. /// /// @@ -113,7 +113,7 @@ public class DefaultReader /// /// Constructs the default reader for the given schemas using the DefaultReader. If the /// reader's and writer's schemas are different this class performs the resolution. - /// This default implemenation maps Avro types to .NET types as follows: + /// This default implementation maps Avro types to .NET types as follows: /// /// The schema used while generating the data /// The schema desired by the reader @@ -131,7 +131,7 @@ public DefaultReader(Schema writerSchema, Schema readerSchema) /// The type of object to read. A single schema typically returns an object of a single .NET class. /// The only exception is UnionSchema, which can return a object of different types based on the branch selected. /// - /// If not null, the implemenation will try to use to return the object + /// If not null, the implementation will try to use to return the object /// The decoder for deserialization /// Object read from the decoder. public T Read(T reuse, Decoder decoder) @@ -143,7 +143,7 @@ public T Read(T reuse, Decoder decoder) /// Reads an object off the stream. /// /// - /// If not null, the implemenation will try to use to return the object. + /// If not null, the implementation will try to use to return the object. /// /// Schema used to write the data. /// Schema to use when reading the data. @@ -356,7 +356,7 @@ protected virtual void AddField(object record, string fieldName, int fieldPos, o /// /// Deserializes a enum. Uses CreateEnum to construct the new enum object. /// - /// If appropirate, uses this instead of creating a new enum object. + /// If appropriate, uses this instead of creating a new enum object. /// The schema the writer used while writing the enum /// The schema the reader is using /// The decoder for deserialization. @@ -372,7 +372,7 @@ protected virtual object ReadEnum(object reuse, EnumSchema writerSchema, Schema /// If appropriate, use this enum object instead of a new one. /// The enum schema used by the reader. /// The symbol that needs to be used. - /// The default implemenation returns a GenericEnum. + /// The default implementation returns a GenericEnum. protected virtual object CreateEnum(object reuse, EnumSchema es, string symbol) { if (reuse is GenericEnum) @@ -430,7 +430,7 @@ protected virtual object CreateArray(object reuse, ArraySchema rs) /// /// Returns the size of the given array object. /// - /// Array object whose size is required. This is guaranteed to be somthing returned by + /// Array object whose size is required. This is guaranteed to be something returned by /// a previous call to CreateArray(). /// The size of the array protected virtual int GetArraySize(object array) @@ -441,7 +441,7 @@ protected virtual int GetArraySize(object array) /// /// Resizes the array to the new value. /// - /// Array object whose size is required. This is guaranteed to be somthing returned by + /// Array object whose size is required. This is guaranteed to be something returned by /// a previous call to CreateArray(). /// The new size. protected virtual void ResizeArray(ref object array, int n) @@ -454,7 +454,7 @@ protected virtual void ResizeArray(ref object array, int n) /// /// Assigns a new value to the object at the given index /// - /// Array object whose size is required. This is guaranteed to be somthing returned by + /// Array object whose size is required. This is guaranteed to be something returned by /// a previous call to CreateArray(). /// The index to reassign to. /// The value to assign. @@ -467,7 +467,7 @@ protected virtual void SetArrayElement(object array, int index, object value) /// /// Returns the element at the given index. /// - /// Array object whose size is required. This is guaranteed to be somthing returned by + /// Array object whose size is required. This is guaranteed to be something returned by /// a previous call to CreateArray(). /// The index to look into. /// The object the given index. Null if no object has been assigned to that index. @@ -477,7 +477,7 @@ protected virtual object GetArrayElement(object array, int index) } /// - /// Deserialized an avro map. The default implemenation creats a new map using CreateMap() and then + /// Deserialized an avro map. The default implementation creates a new map using CreateMap() and then /// adds elements to the map using AddMapEntry(). /// /// If appropriate, use this instead of creating a new map object. @@ -502,7 +502,7 @@ protected virtual object ReadMap(object reuse, MapSchema writerSchema, Schema re /// /// Used by the default implementation of ReadMap() to create a fresh map object. The default - /// implementaion of this method returns a IDictionary<string, map>. + /// implementation of this method returns a IDictionary<string, map>. /// /// If appropriate, use this map object instead of creating a new one. /// Map schema to use when creating the object. @@ -530,7 +530,7 @@ protected virtual void AddMapEntry(object map, string key, object value) } /// - /// Deserialized an object based on the writer's uninon schema. + /// Deserialized an object based on the writer's union schema. /// /// If appropriate, uses this object instead of creating a new one. /// The UnionSchema that the writer used. @@ -573,10 +573,10 @@ protected virtual object ReadLogical(object reuse, LogicalSchema writerSchema, S /// /// If appropriate, uses this object instead of creating a new one. /// The FixedSchema the writer used during serialization. - /// The schema that the readr uses. Must be a FixedSchema with the same + /// The schema that the reader uses. Must be a FixedSchema with the same /// size as the writerSchema. /// The decoder for deserialization. - /// The deserilized object. + /// The deserialized object. protected virtual object ReadFixed(object reuse, FixedSchema writerSchema, Schema readerSchema, Decoder d) { FixedSchema rs = (FixedSchema)readerSchema; diff --git a/lang/csharp/src/apache/main/Generic/GenericWriter.cs b/lang/csharp/src/apache/main/Generic/GenericWriter.cs index 79ff3b20867..92d5d99f85e 100644 --- a/lang/csharp/src/apache/main/Generic/GenericWriter.cs +++ b/lang/csharp/src/apache/main/Generic/GenericWriter.cs @@ -75,7 +75,7 @@ public void Write(T value, Encoder encoder) /// A General purpose writer for serializing objects into a Stream using /// Avro. This class implements a default way of serializing objects. But /// one can derive a class from this and override different methods to - /// acheive results that are different from the default implementation. + /// achieve results that are different from the default implementation. /// public class DefaultWriter { @@ -246,7 +246,7 @@ protected virtual object GetField(object value, string fieldName, int fieldPos) } /// - /// Serializes an enumeration. The default implementation expectes the value to be string whose + /// Serializes an enumeration. The default implementation expects the value to be string whose /// value is the name of the enumeration. /// /// The EnumSchema for serialization @@ -293,8 +293,8 @@ protected virtual void EnsureArrayObject(object value) /// /// Returns the length of an array. The default implementation requires the object - /// to be an array of objects and returns its length. The defaul implementation - /// gurantees that EnsureArrayObject() has been called on the value before this + /// to be an array of objects and returns its length. The default implementation + /// guarantees that EnsureArrayObject() has been called on the value before this /// function is called. /// /// The object whose array length is required @@ -306,8 +306,8 @@ protected virtual long GetArrayLength(object value) /// /// Returns the element at the given index from the given array object. The default implementation - /// requires that the value is an object array and returns the element in that array. The defaul implementation - /// gurantees that EnsureArrayObject() has been called on the value before this + /// requires that the value is an object array and returns the element in that array. The default implementation + /// guarantees that EnsureArrayObject() has been called on the value before this /// function is called. /// /// The array object @@ -351,7 +351,7 @@ protected virtual void EnsureMapObject(object value) } /// - /// Returns the size of the map object. The default implementation gurantees that EnsureMapObject has been + /// Returns the size of the map object. The default implementation guarantees that EnsureMapObject has been /// successfully called with the given value. The default implementation requires the value /// to be an IDictionary<string, object> and returns the number of elements in it. /// @@ -364,7 +364,7 @@ protected virtual long GetMapSize(object value) /// /// Returns the contents of the given map object. The default implementation guarantees that EnsureMapObject - /// has been called with the given value. The defualt implementation of this method requires that + /// has been called with the given value. The default implementation of this method requires that /// the value is an IDictionary<string, object> and returns its contents. /// /// The map object whose size is desired @@ -437,7 +437,7 @@ protected virtual void WriteFixed(FixedSchema es, object value, Encoder encoder) /// /// Creates a new and uses the provided parameters to build an - /// exception message indicathing there was a type mismatch. + /// exception message indicating there was a type mismatch. /// /// Object whose type does not the expected type /// Schema that we tried to write against diff --git a/lang/csharp/src/apache/main/Generic/PreresolvingDatumReader.cs b/lang/csharp/src/apache/main/Generic/PreresolvingDatumReader.cs index a4b4aa832fb..61273e85a49 100644 --- a/lang/csharp/src/apache/main/Generic/PreresolvingDatumReader.cs +++ b/lang/csharp/src/apache/main/Generic/PreresolvingDatumReader.cs @@ -619,7 +619,7 @@ protected interface ArrayAccess /// Hint that the array should be able to handle at least targetSize elements. The array /// is not required to be resized /// - /// Array object who needs to support targetSize elements. This is guaranteed to be somthing returned by + /// Array object who needs to support targetSize elements. This is guaranteed to be something returned by /// a previous call to CreateArray(). /// The new size. void EnsureSize(ref object array, int targetSize); @@ -627,7 +627,7 @@ protected interface ArrayAccess /// /// Resizes the array to the new value. /// - /// Array object whose size is required. This is guaranteed to be somthing returned by + /// Array object whose size is required. This is guaranteed to be something returned by /// a previous call to CreateArray(). /// The new size. void Resize(ref object array, int targetSize); diff --git a/lang/csharp/src/apache/main/Generic/PreresolvingDatumWriter.cs b/lang/csharp/src/apache/main/Generic/PreresolvingDatumWriter.cs index a90ac34349b..f37299d376c 100644 --- a/lang/csharp/src/apache/main/Generic/PreresolvingDatumWriter.cs +++ b/lang/csharp/src/apache/main/Generic/PreresolvingDatumWriter.cs @@ -332,7 +332,7 @@ protected int ResolveUnion(UnionSchema us, Schema[] branchSchemas, object obj) /// /// Creates a new and uses the provided parameters to build an - /// exception message indicathing there was a type mismatch. + /// exception message indicating there was a type mismatch. /// /// Object whose type does not the expected type /// Schema that we tried to write against @@ -383,8 +383,8 @@ protected interface ArrayAccess /// /// Returns the length of an array. The default implementation requires the object - /// to be an array of objects and returns its length. The defaul implementation - /// gurantees that EnsureArrayObject() has been called on the value before this + /// to be an array of objects and returns its length. The default implementation + /// guarantees that EnsureArrayObject() has been called on the value before this /// function is called. /// /// The object whose array length is required @@ -416,7 +416,7 @@ protected interface MapAccess void EnsureMapObject(object value); /// - /// Returns the size of the map object. The default implementation gurantees that EnsureMapObject has been + /// Returns the size of the map object. The default implementation guarantees that EnsureMapObject has been /// successfully called with the given value. The default implementation requires the value /// to be an IDictionary<string, object> and returns the number of elements in it. /// diff --git a/lang/csharp/src/apache/main/IO/ByteBufferInputStream.cs b/lang/csharp/src/apache/main/IO/ByteBufferInputStream.cs index b077bfd3f18..278bc59b76e 100644 --- a/lang/csharp/src/apache/main/IO/ByteBufferInputStream.cs +++ b/lang/csharp/src/apache/main/IO/ByteBufferInputStream.cs @@ -83,7 +83,7 @@ private MemoryStream GetNextNonEmptyBuffer() /// Throws a . /// /// - /// Always thows. + /// Always throws. /// public override long Length { diff --git a/lang/csharp/src/apache/main/IO/Decoder.cs b/lang/csharp/src/apache/main/IO/Decoder.cs index 536c1e93956..6270a4177ac 100644 --- a/lang/csharp/src/apache/main/IO/Decoder.cs +++ b/lang/csharp/src/apache/main/IO/Decoder.cs @@ -102,7 +102,7 @@ public interface Decoder /// /// Starts reading the map Avro type. This, together with ReadMapNext() is used to read the /// entries from Avro map. This returns the number of entries in the initial chunk. After consuming - /// the chunk, the client should call ReadMapNext() to get the number of entriess in the next + /// the chunk, the client should call ReadMapNext() to get the number of entries in the next /// chunk. The client should repeat the procedure until there are no more entries in the array. /// for (int n = decoder.ReadMapStart(); n > 0; n = decoder.ReadMapNext()) /// { diff --git a/lang/csharp/src/apache/main/IO/Encoder.cs b/lang/csharp/src/apache/main/IO/Encoder.cs index 000a06eed8b..ee26a751205 100644 --- a/lang/csharp/src/apache/main/IO/Encoder.cs +++ b/lang/csharp/src/apache/main/IO/Encoder.cs @@ -19,7 +19,7 @@ namespace Avro.IO { /// - /// Defines the interface for a class that provies low-level support for serializing Avro + /// Defines the interface for a class that provides low-level support for serializing Avro /// values. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", diff --git a/lang/csharp/src/apache/main/Reflect/ArraySchemaExtensions.cs b/lang/csharp/src/apache/main/Reflect/ArraySchemaExtensions.cs index 33ae5f55682..10466cc8ae6 100644 --- a/lang/csharp/src/apache/main/Reflect/ArraySchemaExtensions.cs +++ b/lang/csharp/src/apache/main/Reflect/ArraySchemaExtensions.cs @@ -27,7 +27,7 @@ public static class ArraySchemaExtensions /// Return the name of the array helper /// /// this - /// value of the helper metadata - null if it isnt present + /// value of the helper metadata - null if it isn't present public static string GetHelper(this ArraySchema ars) { string s = null; diff --git a/lang/csharp/src/apache/main/Reflect/ClassCache.cs b/lang/csharp/src/apache/main/Reflect/ClassCache.cs index 430efffbf03..d01d11b492e 100644 --- a/lang/csharp/src/apache/main/Reflect/ClassCache.cs +++ b/lang/csharp/src/apache/main/Reflect/ClassCache.cs @@ -76,7 +76,7 @@ public static void AddDefaultConverter(Func /// /// - /// The first matching converter - null if there isnt one + /// The first matching converter - null if there isn't one public IAvroFieldConverter GetDefaultConverter(Avro.Schema.Type tag, Type propType) { Type avroType; @@ -159,7 +159,7 @@ public void AddArrayHelper(string name, Type helperType) public ArrayHelper GetArrayHelper(ArraySchema schema, IEnumerable enumerable) { Type h; - // note ArraySchema is unamed and doesnt have a FulllName, use "helper" metadata + // note ArraySchema is unnamed and doesn't have a FulllName, use "helper" metadata // metadata is json string, strip quotes string s = null; s = schema.GetHelper(); diff --git a/lang/csharp/src/apache/main/Reflect/DotnetClass.cs b/lang/csharp/src/apache/main/Reflect/DotnetClass.cs index 5bef040f631..0d6d4359b30 100644 --- a/lang/csharp/src/apache/main/Reflect/DotnetClass.cs +++ b/lang/csharp/src/apache/main/Reflect/DotnetClass.cs @@ -83,7 +83,7 @@ private PropertyInfo GetPropertyInfo(Field f) } } - throw new AvroException($"Class {_type.Name} doesnt contain property {f.Name}"); + throw new AvroException($"Class {_type.Name} doesn't contain property {f.Name}"); } /// @@ -97,7 +97,7 @@ public object GetValue(object o, Field f) DotnetProperty p; if (!_propertyMap.TryGetValue(f.Name, out p)) { - throw new AvroException($"ByPosClass doesnt contain property {f.Name}"); + throw new AvroException($"ByPosClass doesn't contain property {f.Name}"); } return p.GetValue(o, f.Schema); @@ -108,13 +108,13 @@ public object GetValue(object o, Field f) /// /// the object /// field schema - /// value for the proprty referenced by the field schema + /// value for the property referenced by the field schema public void SetValue(object o, Field f, object v) { DotnetProperty p; if (!_propertyMap.TryGetValue(f.Name, out p)) { - throw new AvroException($"ByPosClass doesnt contain property {f.Name}"); + throw new AvroException($"ByPosClass doesn't contain property {f.Name}"); } p.SetValue(o, v, f.Schema); @@ -139,7 +139,7 @@ public Type GetPropertyType(Field f) DotnetProperty p; if (!_propertyMap.TryGetValue(f.Name, out p)) { - throw new AvroException($"ByPosClass doesnt contain property {f.Name}"); + throw new AvroException($"ByPosClass doesn't contain property {f.Name}"); } return p.GetPropertyType(); diff --git a/lang/csharp/src/apache/main/Reflect/EnumCache.cs b/lang/csharp/src/apache/main/Reflect/EnumCache.cs index 7fbfc998d12..463758915f4 100644 --- a/lang/csharp/src/apache/main/Reflect/EnumCache.cs +++ b/lang/csharp/src/apache/main/Reflect/EnumCache.cs @@ -48,7 +48,7 @@ public static Type GetEnumeration(NamedSchema schema) Type t; if (!_nameEnumMap.TryGetValue(schema.Fullname, out t)) { - throw new AvroException($"Couldnt find enumeration for avro fullname: {schema.Fullname}"); + throw new AvroException($"Couldn't find enumeration for avro fullname: {schema.Fullname}"); } return t; diff --git a/lang/csharp/src/apache/main/Reflect/README.md b/lang/csharp/src/apache/main/Reflect/README.md index 3573c6a309e..e3cb2e4cc48 100644 --- a/lang/csharp/src/apache/main/Reflect/README.md +++ b/lang/csharp/src/apache/main/Reflect/README.md @@ -1,12 +1,12 @@ # Namespace Avro.Reflect -This namespace contains classes that implement Avro serialization and deserialization for plain C# objects. The classes use .net reflection to implement the serializers. The interface is similar to the Generic and Specific serialiation classes. +This namespace contains classes that implement Avro serialization and deserialization for plain C# objects. The classes use .net reflection to implement the serializers. The interface is similar to the Generic and Specific serialization classes. ## Serialization The approach starts with the schema and iterates both the schema and the dotnet type together in a depth first manner per the specification. Serialization is the same as the Generic serializer except where the serializer encounters: - *A fixed type*: if the corresponding dotnet object type is a byte[] of the correct length then the object is serialized, otherwise an exception is thrown. -- *A record type*: the serializer matches the schema property name to the dotnet object property name and then reursively serializes the schema property and the dotnet object property +- *A record type*: the serializer matches the schema property name to the dotnet object property name and then recursively serializes the schema property and the dotnet object property - *An array type*: See array serialization/deserialization. Basic serialization is performed as in the following example: @@ -37,7 +37,7 @@ You might want to do this if your class contains interfaces and/or if you use an See the section on Arrays. The ArrayHelper specifies the type of object created when an array is deserialized. The default is List\. -The type created for Map objects is specified by the Deserializer property MapType. *This must be a two (or more) parameter generic type where the first type paramater is string and the second is undefined* e.g. Dictionary. +The type created for Map objects is specified by the Deserializer property MapType. *This must be a two (or more) parameter generic type where the first type parameter is string and the second is undefined* e.g. Dictionary. ```csharp public Type MapType { get; set; } ``` diff --git a/lang/csharp/src/apache/main/Reflect/ReflectDefaultReader.cs b/lang/csharp/src/apache/main/Reflect/ReflectDefaultReader.cs index ded0057ee22..034cb89f88e 100644 --- a/lang/csharp/src/apache/main/Reflect/ReflectDefaultReader.cs +++ b/lang/csharp/src/apache/main/Reflect/ReflectDefaultReader.cs @@ -50,7 +50,7 @@ public class ReflectDefaultReader : SpecificDefaultReader /// /// Delegate to a factory method to create objects of type x. If you are deserializing to interfaces - /// you could use an IoC container factory insread of the default. Default is Activator.CreateInstance() + /// you could use an IoC container factory instead of the default. Default is Activator.CreateInstance() /// /// public Func RecordFactory { get => _recordFactory; set => _recordFactory = value; } @@ -373,7 +373,7 @@ public object GetDefaultValue(Schema s, JToken defaultValue) /// /// Deserializes a enum. Uses CreateEnum to construct the new enum object. /// - /// If appropirate, uses this instead of creating a new enum object. + /// If appropriate, uses this instead of creating a new enum object. /// The schema the writer used while writing the enum /// The schema the reader is using /// The decoder for deserialization. @@ -450,10 +450,10 @@ protected override object ReadRecord(object reuse, RecordSchema writerSchema, Sc /// /// If appropriate, uses this object instead of creating a new one. /// The FixedSchema the writer used during serialization. - /// The schema that the readr uses. Must be a FixedSchema with the same + /// The schema that the reader uses. Must be a FixedSchema with the same /// size as the writerSchema. /// The decoder for deserialization. - /// The deserilized object. + /// The deserialized object. protected override object ReadFixed(object reuse, FixedSchema writerSchema, Schema readerSchema, Decoder d) { FixedSchema rs = readerSchema as FixedSchema; diff --git a/lang/csharp/src/apache/main/Reflect/ReflectReader.cs b/lang/csharp/src/apache/main/Reflect/ReflectReader.cs index 0c2df58a9a5..e39e30d32cf 100644 --- a/lang/csharp/src/apache/main/Reflect/ReflectReader.cs +++ b/lang/csharp/src/apache/main/Reflect/ReflectReader.cs @@ -72,7 +72,7 @@ public ReflectReader(ReflectDefaultReader reader) /// Generic read function /// /// object to store data read - /// decorder to use for reading data + /// decoder to use for reading data /// public T Read(T reuse, Decoder dec) { @@ -82,7 +82,7 @@ public T Read(T reuse, Decoder dec) /// /// Generic read function /// - /// decorder to use for reading data + /// decoder to use for reading data /// public T Read(Decoder dec) { diff --git a/lang/csharp/src/apache/main/Schema/JsonHelper.cs b/lang/csharp/src/apache/main/Schema/JsonHelper.cs index 1ca51cb4848..ccdf8f7345a 100644 --- a/lang/csharp/src/apache/main/Schema/JsonHelper.cs +++ b/lang/csharp/src/apache/main/Schema/JsonHelper.cs @@ -82,7 +82,7 @@ public static int GetRequiredInteger(JToken jtok, string field) /// /// JSON object to read /// property name - /// null if property doesn't exist, otherise returns property boolean value + /// null if property doesn't exist, otherwise returns property boolean value public static bool? GetOptionalBoolean(JToken jtok, string field) { if (null == jtok) throw new ArgumentNullException(nameof(jtok), "jtok cannot be null."); diff --git a/lang/csharp/src/apache/main/Schema/Property.cs b/lang/csharp/src/apache/main/Schema/Property.cs index f4240721f1a..1774bebff87 100644 --- a/lang/csharp/src/apache/main/Schema/Property.cs +++ b/lang/csharp/src/apache/main/Schema/Property.cs @@ -36,7 +36,7 @@ public class PropertyMap : Dictionary /// Parses the custom properties from the given JSON object and stores them /// into the schema's list of custom properties /// - /// JSON object to prase + /// JSON object to parse public void Parse(JToken jtok) { JObject jo = jtok as JObject; diff --git a/lang/csharp/src/apache/main/Schema/RecordSchema.cs b/lang/csharp/src/apache/main/Schema/RecordSchema.cs index 6f01d0ca898..356f8baf4a2 100644 --- a/lang/csharp/src/apache/main/Schema/RecordSchema.cs +++ b/lang/csharp/src/apache/main/Schema/RecordSchema.cs @@ -354,9 +354,9 @@ public RecordSchemaPair(RecordSchema first, RecordSchema second) * we can detect it. * * The infinite loop happens in ToString(), Equals() and GetHashCode() methods. - * Though it does not happen for CanRead() because of the current implemenation of UnionSchema's can read, - * it could potenitally happen. - * We do a linear seach for the marker as we don't expect the list to be very long. + * Though it does not happen for CanRead() because of the current implementation of UnionSchema's can read, + * it could potentially happen. + * We do a linear search for the marker as we don't expect the list to be very long. */ private T protect(Function bypass, Function main, RecordSchema that) { diff --git a/lang/csharp/src/apache/main/Schema/SchemaName.cs b/lang/csharp/src/apache/main/Schema/SchemaName.cs index 20cc1b43d89..11d22daa515 100644 --- a/lang/csharp/src/apache/main/Schema/SchemaName.cs +++ b/lang/csharp/src/apache/main/Schema/SchemaName.cs @@ -64,7 +64,7 @@ public class SchemaName /// name of the schema /// namespace of the schema /// enclosing namespace of the schema - /// documentation o fthe schema + /// documentation of the schema public SchemaName(String name, String space, String encspace, String documentation) { if (name == null) diff --git a/lang/csharp/src/apache/main/Schema/SchemaNormalization.cs b/lang/csharp/src/apache/main/Schema/SchemaNormalization.cs index 3b12d04ec52..d6c5a45cf12 100644 --- a/lang/csharp/src/apache/main/Schema/SchemaNormalization.cs +++ b/lang/csharp/src/apache/main/Schema/SchemaNormalization.cs @@ -24,13 +24,13 @@ namespace Avro { /// - /// Collection of static methods for generating the cannonical form of schemas. + /// Collection of static methods for generating the canonical form of schemas. /// public static class SchemaNormalization { /// /// Obsolete: This will be removed from the public API in a future version. - /// This should be a private const field, similar to the Java implementation. It appears + /// This should be a private constant field, similar to the Java implementation. It appears /// that this was originally exposed for unit tests. Unit tests should hard-code this value /// rather than access it here. /// @@ -71,7 +71,7 @@ public static string ToParsingForm(Schema s) /// not recognized and an /// ArgumentException is thrown /// - /// Recommended Avro practice dictiates that + /// Recommended Avro practice dictates that /// "CRC-64-AVRO" is used for 64-bit fingerprints, /// "MD5" is used for 128-bit fingerprints, and /// "SHA-256" is used for 256-bit fingerprints. diff --git a/lang/csharp/src/apache/main/Schema/UnionSchema.cs b/lang/csharp/src/apache/main/Schema/UnionSchema.cs index 0ffb5e091f7..e74fa954159 100644 --- a/lang/csharp/src/apache/main/Schema/UnionSchema.cs +++ b/lang/csharp/src/apache/main/Schema/UnionSchema.cs @@ -68,7 +68,7 @@ internal static UnionSchema NewInstance(JArray jarr, PropertyMap props, SchemaNa } /// - /// Contructor for union schema + /// Constructor for union schema /// /// /// dictionary that provides access to custom properties diff --git a/lang/csharp/src/apache/main/Specific/SpecificReader.cs b/lang/csharp/src/apache/main/Specific/SpecificReader.cs index a8e8e5970bf..2736cc1898c 100644 --- a/lang/csharp/src/apache/main/Specific/SpecificReader.cs +++ b/lang/csharp/src/apache/main/Specific/SpecificReader.cs @@ -72,7 +72,7 @@ public SpecificReader(SpecificDefaultReader reader) /// Generic read function /// /// object to store data read - /// decorder to use for reading data + /// decoder to use for reading data /// public T Read(T reuse, Decoder dec) { @@ -155,10 +155,10 @@ protected override object ReadRecord(object reuse, RecordSchema writerSchema, Sc /// /// If appropriate, uses this object instead of creating a new one. /// The FixedSchema the writer used during serialization. - /// The schema that the readr uses. Must be a FixedSchema with the same + /// The schema that the reader uses. Must be a FixedSchema with the same /// size as the writerSchema. /// The decoder for deserialization. - /// The deserilized object. + /// The deserialized object. protected override object ReadFixed(object reuse, FixedSchema writerSchema, Schema readerSchema, Decoder d) { FixedSchema rs = readerSchema as FixedSchema; @@ -220,7 +220,7 @@ protected override object ReadArray(object reuse, ArraySchema writerSchema, Sche } /// - /// Deserialized an avro map. The default implemenation creats a new map using CreateMap() and then + /// Deserialized an avro map. The default implementation creates a new map using CreateMap() and then /// adds elements to the map using AddMapEntry(). /// /// If appropriate, use this instead of creating a new map object. diff --git a/lang/csharp/src/apache/test/CodGen/CodeGenTest.cs b/lang/csharp/src/apache/test/CodGen/CodeGenTest.cs index 243d93e24c5..e514347206e 100644 --- a/lang/csharp/src/apache/test/CodGen/CodeGenTest.cs +++ b/lang/csharp/src/apache/test/CodGen/CodeGenTest.cs @@ -63,7 +63,7 @@ public void TestReservedKeywords() [TestCase("a.b.int", "a.b.@int")] [TestCase("int.long.while", "@int.@long.@while")] // Reserved keywords [TestCase("a.value.partial", "a.value.partial")] // Contextual keywords - [TestCase("a.value.b.int.c.while.longpartial", "a.value.b.@int.c.@while.longpartial")] // Rseserved and contextual keywords + [TestCase("a.value.b.int.c.while.longpartial", "a.value.b.@int.c.@while.longpartial")] // Reserved and contextual keywords public void TestMangleUnMangle(string input, string mangled) { // Mangle diff --git a/lang/csharp/src/apache/test/File/FileTests.cs b/lang/csharp/src/apache/test/File/FileTests.cs index e54b353147a..666318b6899 100644 --- a/lang/csharp/src/apache/test/File/FileTests.cs +++ b/lang/csharp/src/apache/test/File/FileTests.cs @@ -298,7 +298,7 @@ public void TestGenericData(string schemaStr, object[] value, Codec.Type codecTy } Assert.IsTrue((readFoos != null && readFoos.Count > 0), - string.Format(@"Generic object: {0} did not serialise/deserialise correctly", readFoos)); + string.Format(@"Generic object: {0} did not serialize/deserialize correctly", readFoos)); } } @@ -324,7 +324,7 @@ private static IEnumerable TestAppendGenericDataSource() /// schema /// initial records /// append records - /// innitial compression codec type + /// initial compression codec type [TestCaseSource(nameof(TestAppendGenericDataSource))] public void TestAppendGenericData(string schemaStr, object[] recs, object[] appendRecs, Codec.Type codecType) { @@ -362,7 +362,7 @@ public void TestAppendGenericData(string schemaStr, object[] recs, object[] appe Assert.NotNull(readFoos); Assert.AreEqual((recs.Length + appendRecs.Length) / 2, readFoos.Count, - $"Generic object: {readFoos} did not serialise/deserialise correctly"); + $"Generic object: {readFoos} did not serialize/deserialize correctly"); } } @@ -432,7 +432,7 @@ public void TestNonSeekableStream(string schemaStr, object[] value, Codec.Type c } Assert.IsTrue((readFoos != null && readFoos.Count > 0), - string.Format(@"Generic object: {0} did not serialise/deserialise correctly", readFoos)); + string.Format(@"Generic object: {0} did not serialize/deserialize correctly", readFoos)); } } @@ -812,7 +812,7 @@ public void TestSyncAndSeekPositions(string schemaStr, Codec.Type codecType, int } } - // verify syncs wth seeks + // verify syncs with seeks reader.Sync(0); // first sync Assert.AreEqual(reader.PreviousSync(), syncs[0], string.Format("Error syncing reader to position: {0}", syncs[0])); diff --git a/lang/csharp/src/apache/test/IO/BinaryCodecTests.cs b/lang/csharp/src/apache/test/IO/BinaryCodecTests.cs index f894d7bfc4f..a638b73fea2 100644 --- a/lang/csharp/src/apache/test/IO/BinaryCodecTests.cs +++ b/lang/csharp/src/apache/test/IO/BinaryCodecTests.cs @@ -32,7 +32,7 @@ namespace Avro.Test delegate void Encode(Encoder e, T t); /// - /// Tests the BinaryEncoder and BinaryDecoder. This is pertty general set of test cases and hence + /// Tests the BinaryEncoder and BinaryDecoder. This is pretty general set of test cases and hence /// can be used for any encoder and its corresponding decoder. /// [TestFixture] diff --git a/lang/csharp/src/apache/test/Specific/SpecificTests.cs b/lang/csharp/src/apache/test/Specific/SpecificTests.cs index 1ba6840d45c..178f255449b 100644 --- a/lang/csharp/src/apache/test/Specific/SpecificTests.cs +++ b/lang/csharp/src/apache/test/Specific/SpecificTests.cs @@ -572,7 +572,7 @@ private static void AssertSpecificRecordEqual(ISpecificRecord rec1, ISpecificRec } /// - /// Asserts that two lists are equal, delegating the work of comapring + /// Asserts that two lists are equal, delegating the work of comparing /// entries to /// . /// diff --git a/lang/csharp/src/apache/test/Util/LogicalTypeTests.cs b/lang/csharp/src/apache/test/Util/LogicalTypeTests.cs index 32ce7c3b115..9630b7c6716 100644 --- a/lang/csharp/src/apache/test/Util/LogicalTypeTests.cs +++ b/lang/csharp/src/apache/test/Util/LogicalTypeTests.cs @@ -49,7 +49,7 @@ public void TestDecimalConvert(string s, int scale, byte[] converted) var decimalVal = (AvroDecimal)decimal.Parse(s, CultureInfo.InvariantCulture); // TestDecimal tests ConvertToLogicalValue(ConvertToBaseValue(...)) which might hide symmetrical breaking changes in both functions - // The following 2 tests are checking the conversions seperately + // The following 2 tests are checking the conversions separately // Validate Decimal.ConvertToBaseValue Assert.AreEqual(converted, avroDecimal.ConvertToBaseValue(decimalVal, schema)); diff --git a/lang/csharp/src/apache/test/Utils/VersionTests.cs b/lang/csharp/src/apache/test/Utils/VersionTests.cs index 7492230d5c0..20d7ed2f421 100644 --- a/lang/csharp/src/apache/test/Utils/VersionTests.cs +++ b/lang/csharp/src/apache/test/Utils/VersionTests.cs @@ -1,4 +1,4 @@ -/** +/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -23,7 +23,7 @@ namespace Avro.Test.Utils { public class VersionTests { - // SemVer2.0 regex + // SemVer2.0 Regular Expression public static string SemVerRegex = @"^((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)$"; [Test] @@ -32,7 +32,7 @@ public void VersionTest() // Avro library's assembly Assembly assembly = typeof(Schema).Assembly; - // Note: InformationalVersion contains pre-release tag if available (e.g. 1.x.y-beta.z) + // Note: InformationalVersion contains prerelease tag if available (e.g. 1.x.y-beta.z) string libraryVersion = assembly.GetCustomAttribute().InformationalVersion; // Check version is SmeVer 2.0 compliant diff --git a/lang/csharp/versions.props b/lang/csharp/versions.props index cf4643d22bf..d1c39164f5e 100644 --- a/lang/csharp/versions.props +++ b/lang/csharp/versions.props @@ -32,7 +32,7 @@ 4.7.0 4.7.0 - + 1.3.3 1.3.0 4.1.0 @@ -40,7 +40,7 @@ + 6.0.0 7.0.0-preview* 17.1.0