Skip to content

Commit

Permalink
Fix nullable warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
CurtHagenlocher committed May 13, 2024
1 parent 2f135fa commit 8d2ae1e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions csharp/src/Apache.Arrow/Arrays/BinaryArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ IEnumerator<byte[]> IEnumerable<byte[]>.GetEnumerator()

int ICollection<byte[]>.Count => Length;
bool ICollection<byte[]>.IsReadOnly => true;
void ICollection<byte[]>.Add(byte[]? item) => throw new NotSupportedException("Collection is read-only.");
bool ICollection<byte[]>.Remove(byte[]? item) => throw new NotSupportedException("Collection is read-only.");
void ICollection<byte[]>.Add(byte[] item) => throw new NotSupportedException("Collection is read-only.");
bool ICollection<byte[]>.Remove(byte[] item) => throw new NotSupportedException("Collection is read-only.");
void ICollection<byte[]>.Clear() => throw new NotSupportedException("Collection is read-only.");

bool ICollection<byte[]>.Contains(byte[] item)
Expand Down
6 changes: 3 additions & 3 deletions csharp/test/Apache.Arrow.Tests/ArrowArrayTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@ private static void TestPrimitiveArrayAsCollection<T, TArray, TArrayBuilder>(IRe
// Parameter 'values' must contain four values. The last value must be distinct from the rest.
private static void TestObjectArrayAsCollection<T, TArray>(TArray array, T nullValue, IReadOnlyList<T> values)
where T : class
where TArray : IArrowArray, ICollection<T?>
where TArray : IArrowArray, ICollection<T>
{
Assert.NotNull(array);
Assert.Equal(4, values.Count);
var collection = (ICollection<T?>)array;
var collection = (ICollection<T>)array;

Assert.Equal(array.Length, collection.Count);
Assert.Equal(4, collection.Count);
Expand All @@ -232,7 +232,7 @@ private static void TestObjectArrayAsCollection<T, TArray>(TArray array, T nullV
Assert.False(collection.Contains(values[3]));

T sentinel = values[2];
T?[] destArr = { sentinel, sentinel, sentinel, sentinel, sentinel, sentinel };
T[] destArr = { sentinel, sentinel, sentinel, sentinel, sentinel, sentinel };
collection.CopyTo(destArr, 1);
Assert.Equal(sentinel, destArr[0]);
Assert.Equal(values[0], destArr[1]);
Expand Down

0 comments on commit 8d2ae1e

Please sign in to comment.