Skip to content

Commit

Permalink
Removed all nullable code until it's turned on.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshClose committed Jan 23, 2024
1 parent 02233b5 commit 6be308a
Show file tree
Hide file tree
Showing 63 changed files with 182 additions and 182 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class HeaderPrefixAttribute : Attribute, IMemberReferenceMapper, IParamet
/// <summary>
/// Gets the prefix.
/// </summary>
public string? Prefix { get; private set; }
public string Prefix { get; private set; }

/// <summary>
/// Gets a value indicating if the prefix should inherit parent prefixes.
Expand Down
6 changes: 3 additions & 3 deletions src/CsvHelper/Configuration/ClassMapCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class ClassMapCollection
/// </value>
/// <param name="type">The record type.</param>
/// <returns>The <see cref="ClassMap"/> for the specified record type.</returns>
public virtual ClassMap? this[Type type]
public virtual ClassMap this[Type type]
{
get
{
Expand Down Expand Up @@ -63,9 +63,9 @@ public ClassMapCollection(CsvContext context)
/// </summary>
/// <typeparam name="T">The record type.</typeparam>
/// <returns>The <see cref="ClassMap"/> for the specified record type.</returns>
public virtual ClassMap<T>? Find<T>()
public virtual ClassMap<T> Find<T>()
{
return (ClassMap<T>?)this[typeof(T)];
return (ClassMap<T>)this[typeof(T)];
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions src/CsvHelper/Configuration/ConfigurationFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public static string GetDynamicPropertyName(GetDynamicPropertyNameArgs args)
/// Return the detected delimiter or null if one wasn't found.
/// </summary>
/// <param name="args">The args.</param>
public static string? GetDelimiter(GetDelimiterArgs args)
public static string GetDelimiter(GetDelimiterArgs args)
{
var text = args.Text;
var config = args.Configuration;
Expand Down Expand Up @@ -244,7 +244,7 @@ orderby sum descending
}
).ToList();

string? newDelimiter = null;
string newDelimiter = null;
if (delimiters.Any(x => x.Delimiter == config.CultureInfo.TextInfo.ListSeparator) && lineDelimiterCounts.Count > 1)
{
// The culture's separator is on every line. Assume this is the delimiter.
Expand Down
8 changes: 4 additions & 4 deletions src/CsvHelper/Configuration/CsvConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public record CsvConfiguration : IReaderConfiguration, IWriterConfiguration
public virtual bool DetectColumnCountChanges { get; set; }

/// <inheritdoc/>
public virtual IComparer<string>? DynamicPropertySort { get; set; }
public virtual IComparer<string> DynamicPropertySort { get; set; }

/// <inheritdoc/>
public virtual Encoding Encoding { get; set; } = Encoding.UTF8;
Expand Down Expand Up @@ -142,13 +142,13 @@ public virtual string NewLine
public virtual ReadingExceptionOccurred ReadingExceptionOccurred { get; set; } = ConfigurationFunctions.ReadingExceptionOccurred;

/// <inheritdoc/>
public virtual ReferenceHeaderPrefix? ReferenceHeaderPrefix { get; set; }
public virtual ReferenceHeaderPrefix ReferenceHeaderPrefix { get; set; }

/// <inheritdoc/>
public ShouldQuote ShouldQuote { get; set; } = ConfigurationFunctions.ShouldQuote;

/// <inheritdoc/>
public virtual ShouldSkipRecord? ShouldSkipRecord { get; set; }
public virtual ShouldSkipRecord ShouldSkipRecord { get; set; }

/// <inheritdoc/>
public virtual ShouldUseConstructorParameters ShouldUseConstructorParameters { get; set; } = ConfigurationFunctions.ShouldUseConstructorParameters;
Expand All @@ -171,7 +171,7 @@ public virtual string NewLine
/// <param name="cultureInfo">The culture information.</param>
/// <param name="attributesType">The type that contains the configuration attributes.
/// This will call <see cref="ApplyAttributes(Type)"/> automatically.</param>
public CsvConfiguration(CultureInfo cultureInfo, Type? attributesType = null)
public CsvConfiguration(CultureInfo cultureInfo, Type attributesType = null)
{
CultureInfo = cultureInfo;
Delimiter = cultureInfo.TextInfo.ListSeparator;
Expand Down
2 changes: 1 addition & 1 deletion src/CsvHelper/Configuration/IReaderConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public interface IReaderConfiguration : IParserConfiguration
/// Gets the callback that will be called to
/// determine whether to skip the given record or not.
/// </summary>
ShouldSkipRecord? ShouldSkipRecord { get; }
ShouldSkipRecord ShouldSkipRecord { get; }

/// <summary>
/// Gets a value indicating if private
Expand Down
2 changes: 1 addition & 1 deletion src/CsvHelper/Configuration/MemberMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public virtual MemberMap Ignore(bool ignore)
/// </summary>
/// <param name="defaultValue">The default value.</param>
/// <param name="useOnConversionFailure">Use default on conversion failure.</param>
public virtual MemberMap Default(object? defaultValue, bool useOnConversionFailure = false)
public virtual MemberMap Default(object defaultValue, bool useOnConversionFailure = false)
{
if (defaultValue == null && Data.Member.MemberType().IsValueType)
{
Expand Down
4 changes: 2 additions & 2 deletions src/CsvHelper/Configuration/MemberMapCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public virtual MemberMap this[int index]
/// <typeparam name="T">The <see cref="System.Type"/> the member is on.</typeparam>
/// <param name="expression">The member expression.</param>
/// <returns>The <see cref="MemberMap"/> for the given expression, or null if not found.</returns>
public virtual MemberMap? Find<T>(Expression<Func<T, object>> expression)
public virtual MemberMap Find<T>(Expression<Func<T, object>> expression)
{
var member = ReflectionHelper.GetMember(expression);
return Find(member);
Expand All @@ -214,7 +214,7 @@ public virtual MemberMap this[int index]
/// </summary>
/// <param name="member">The member.</param>
/// <returns>The <see cref="MemberMap"/> for the given expression, or null if not found.</returns>
public virtual MemberMap? Find(MemberInfo member)
public virtual MemberMap Find(MemberInfo member)
{
var existingMap = list.SingleOrDefault(m =>
m.Data.Member == member ||
Expand Down
10 changes: 5 additions & 5 deletions src/CsvHelper/Configuration/MemberMapData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public virtual Type Type
/// Gets the <see cref="MemberInfo"/> that the data
/// is associated with.
/// </summary>
public virtual MemberInfo? Member { get; private set; }
public virtual MemberInfo Member { get; private set; }

/// <summary>
/// Gets the list of column names.
Expand Down Expand Up @@ -87,7 +87,7 @@ public virtual Type Type
/// <summary>
/// Gets or sets the type converter.
/// </summary>
public virtual ITypeConverter? TypeConverter { get; set; }
public virtual ITypeConverter TypeConverter { get; set; }

/// <summary>
/// Gets or sets the type converter options.
Expand All @@ -102,7 +102,7 @@ public virtual Type Type
/// <summary>
/// Gets or sets the default value used when a CSV field is empty.
/// </summary>
public virtual object? Default { get; set; }
public virtual object Default { get; set; }

/// <summary>
/// Gets or sets a value indicating whether this instance is default value set.
Expand All @@ -121,7 +121,7 @@ public virtual Type Type
/// <summary>
/// Gets or sets the constant value used for every record.
/// </summary>
public virtual object? Constant { get; set; }
public virtual object Constant { get; set; }

/// <summary>
/// Gets or sets a value indicating if a constant was explicitly set.
Expand Down Expand Up @@ -159,7 +159,7 @@ public virtual Type Type
/// Initializes a new instance of the <see cref="MemberMapData"/> class.
/// </summary>
/// <param name="member">The member.</param>
public MemberMapData(MemberInfo? member)
public MemberMapData(MemberInfo member)
{
Member = member;
}
Expand Down
4 changes: 2 additions & 2 deletions src/CsvHelper/Configuration/MemberMap`1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class MemberMap<TClass, TMember> : MemberMap
/// <summary>
/// Creates a new <see cref="MemberMap"/> instance using the specified member.
/// </summary>
public MemberMap(MemberInfo? member)
public MemberMap(MemberInfo member)
{
TypeConverterOption = new MemberMapTypeConverterOption(this);

Expand Down Expand Up @@ -146,7 +146,7 @@ public virtual MemberMap<TClass, TMember> Default(string defaultValue, bool useO
/// what other mapping configurations are specified.
/// </summary>
/// <param name="constantValue">The constant value.</param>
public virtual MemberMap<TClass, TMember> Constant(TMember? constantValue)
public virtual MemberMap<TClass, TMember> Constant(TMember constantValue)
{
Data.Constant = constantValue;
Data.IsConstantSet = true;
Expand Down
2 changes: 1 addition & 1 deletion src/CsvHelper/Configuration/MemberReferenceMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public MemberReferenceMap(MemberInfo member, ClassMap mapping)
/// <param name="prefix">The prefix to be prepended to headers of each reference member.</param>
/// <param name="inherit">Inherit parent prefixes.</param>
/// <returns>The current <see cref="MemberReferenceMap" /></returns>
public MemberReferenceMap Prefix(string? prefix = null, bool inherit = false)
public MemberReferenceMap Prefix(string prefix = null, bool inherit = false)
{
if (string.IsNullOrEmpty(prefix))
{
Expand Down
4 changes: 2 additions & 2 deletions src/CsvHelper/Configuration/MemberReferenceMapCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public virtual void RemoveAt(int index)
/// <typeparam name="T">The <see cref="System.Type"/> the member is on.</typeparam>
/// <param name="expression">The member expression.</param>
/// <returns>The <see cref="MemberReferenceMap"/> for the given expression, or null if not found.</returns>
public virtual MemberReferenceMap? Find<T>(Expression<Func<T, object>> expression)
public virtual MemberReferenceMap Find<T>(Expression<Func<T, object>> expression)
{
var member = ReflectionHelper.GetMember(expression);
return Find(member);
Expand All @@ -147,7 +147,7 @@ public virtual void RemoveAt(int index)
/// </summary>
/// <param name="member">The member.</param>
/// <returns>The <see cref="MemberReferenceMap"/> for the given expression, or null if not found.</returns>
public virtual MemberReferenceMap? Find(MemberInfo member)
public virtual MemberReferenceMap Find(MemberInfo member)
{
var existingMap = list.SingleOrDefault(m =>
m.Data.Member == member ||
Expand Down
4 changes: 2 additions & 2 deletions src/CsvHelper/Configuration/ParameterMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public virtual ParameterMap Ignore(bool ignore)
/// the CSV field is empty.
/// </summary>
/// <param name="defaultValue">The default value.</param>
public virtual ParameterMap Default(object? defaultValue)
public virtual ParameterMap Default(object defaultValue)
{
if (defaultValue == null && Data.Parameter.ParameterType.IsValueType)
{
Expand All @@ -151,7 +151,7 @@ public virtual ParameterMap Default(object? defaultValue)
/// what other mapping configurations are specified.
/// </summary>
/// <param name="constantValue">The constant value.</param>
public virtual ParameterMap Constant(object? constantValue)
public virtual ParameterMap Constant(object constantValue)
{
if (constantValue == null && Data.Parameter.ParameterType.IsValueType)
{
Expand Down
4 changes: 2 additions & 2 deletions src/CsvHelper/Configuration/ParameterMapData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class ParameterMapData
/// <summary>
/// Gets or sets the default value used when a CSV field is empty.
/// </summary>
public virtual object? Default { get; set; }
public virtual object Default { get; set; }

/// <summary>
/// Gets or sets a value indicating whether this instance is default value set.
Expand All @@ -82,7 +82,7 @@ public class ParameterMapData
/// <summary>
/// Gets or sets the constant value used for every record.
/// </summary>
public virtual object? Constant { get; set; }
public virtual object Constant { get; set; }

/// <summary>
/// Gets or sets a value indicating if a constant was explicitly set.
Expand Down
6 changes: 3 additions & 3 deletions src/CsvHelper/CsvDataReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public int FieldCount
/// </summary>
/// <param name="csv">The CSV.</param>
/// <param name="schemaTable">The DataTable representing the file schema.</param>
public CsvDataReader(CsvReader csv, DataTable? schemaTable = null)
public CsvDataReader(CsvReader csv, DataTable schemaTable = null)
{
this.csv = csv;

Expand Down Expand Up @@ -116,7 +116,7 @@ public byte GetByte(int i)
}

/// <inheritdoc />
public long GetBytes(int i, long fieldOffset, byte[]? buffer, int bufferoffset, int length)
public long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length)
{
var bytes = csv.GetField<byte[]>(i);

Expand All @@ -134,7 +134,7 @@ public char GetChar(int i)
}

/// <inheritdoc />
public long GetChars(int i, long fieldoffset, char[]? buffer, int bufferoffset, int length)
public long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length)
{
var chars = csv.GetField(i).ToCharArray();

Expand Down
4 changes: 2 additions & 2 deletions src/CsvHelper/CsvParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class CsvParser : IParser, IDisposable
private bool fieldIsQuoted;
private bool isProcessingField;
private bool isRecordProcessed;
private string[]? record;
private string[] record;

/// <inheritdoc/>
public long CharCount => charCount;
Expand All @@ -86,7 +86,7 @@ public class CsvParser : IParser, IDisposable
public int Row => row;

/// <inheritdoc/>
public string[]? Record
public string[] Record
{
get
{
Expand Down
Loading

0 comments on commit 6be308a

Please sign in to comment.