Skip to content

Commit 809fe7a

Browse files
committed
Remove Jetbrains nullability attributes
1 parent 49b8bb9 commit 809fe7a

File tree

1,581 files changed

+12049
-13488
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,581 files changed

+12049
-13488
lines changed

Diff for: src/EFCore.Abstractions/BackingFieldAttribute.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5-
using JetBrains.Annotations;
65
using Microsoft.EntityFrameworkCore.Utilities;
76

87
namespace Microsoft.EntityFrameworkCore
@@ -17,7 +16,7 @@ public sealed class BackingFieldAttribute : Attribute
1716
/// Initializes a new instance of the <see cref="BackingFieldAttribute" /> class.
1817
/// </summary>
1918
/// <param name="name"> The name of the backing field. </param>
20-
public BackingFieldAttribute([NotNull] string name)
19+
public BackingFieldAttribute(string name)
2120
{
2221
Check.NotEmpty(name, nameof(name));
2322

Diff for: src/EFCore.Abstractions/ChangeTracking/Internal/ObservableBackedBindingList.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System.Collections.Generic;
55
using System.Collections.Specialized;
66
using System.Linq;
7-
using JetBrains.Annotations;
87
using Microsoft.EntityFrameworkCore.Utilities;
98

109
namespace Microsoft.EntityFrameworkCore.ChangeTracking.Internal
@@ -31,7 +30,7 @@ public class ObservableBackedBindingList<T> : SortableBindingList<T>
3130
/// any release. You should only use it directly in your code with extreme caution and knowing that
3231
/// doing so can result in application failures when updating to a new Entity Framework Core release.
3332
/// </summary>
34-
public ObservableBackedBindingList([NotNull] ICollection<T> observableCollection)
33+
public ObservableBackedBindingList(ICollection<T> observableCollection)
3534
: base(observableCollection.ToList())
3635
{
3736
_observableCollection = observableCollection;

Diff for: src/EFCore.Abstractions/ChangeTracking/Internal/SortableBindingList.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class SortableBindingList<T> : BindingList<T>
2828
/// any release. You should only use it directly in your code with extreme caution and knowing that
2929
/// doing so can result in application failures when updating to a new Entity Framework Core release.
3030
/// </summary>
31-
public SortableBindingList([NotNull] List<T> list)
31+
public SortableBindingList(List<T> list)
3232
: base(list)
3333
{
3434
}

Diff for: src/EFCore.Abstractions/ChangeTracking/ObservableCollectionListSource.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public ObservableCollectionListSource()
4040
/// contains elements copied from the specified collection.
4141
/// </summary>
4242
/// <param name="collection"> The collection from which the elements are copied. </param>
43-
public ObservableCollectionListSource([NotNull] IEnumerable<T> collection)
43+
public ObservableCollectionListSource(IEnumerable<T> collection)
4444
: base(collection)
4545
{
4646
}
@@ -50,7 +50,7 @@ public ObservableCollectionListSource([NotNull] IEnumerable<T> collection)
5050
/// contains elements copied from the specified list.
5151
/// </summary>
5252
/// <param name="list"> The list from which the elements are copied. </param>
53-
public ObservableCollectionListSource([NotNull] List<T> list)
53+
public ObservableCollectionListSource(List<T> list)
5454
: base(list)
5555
{
5656
}

Diff for: src/EFCore.Abstractions/CommentAttribute.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5-
using JetBrains.Annotations;
65
using Microsoft.EntityFrameworkCore.Utilities;
76

87
namespace Microsoft.EntityFrameworkCore
@@ -17,7 +16,7 @@ public sealed class CommentAttribute : Attribute
1716
/// Initializes a new instance of the <see cref="CommentAttribute" /> class.
1817
/// </summary>
1918
/// <param name="comment"> The comment. </param>
20-
public CommentAttribute([NotNull] string comment)
19+
public CommentAttribute(string comment)
2120
{
2221
Check.NotEmpty(comment, nameof(comment));
2322

Diff for: src/EFCore.Abstractions/DbFunctionAttribute.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5-
using JetBrains.Annotations;
65
using Microsoft.EntityFrameworkCore.Utilities;
76
using CA = System.Diagnostics.CodeAnalysis;
87

@@ -35,7 +34,7 @@ public DbFunctionAttribute()
3534
/// </summary>
3635
/// <param name="name">The name of the function in the database.</param>
3736
/// <param name="schema">The schema of the function in the database.</param>
38-
public DbFunctionAttribute([NotNull] string name, [CanBeNull] string? schema = null)
37+
public DbFunctionAttribute(string name, string? schema = null)
3938
{
4039
Check.NotEmpty(name, nameof(name));
4140

@@ -50,7 +49,6 @@ public DbFunctionAttribute([NotNull] string name, [CanBeNull] string? schema = n
5049
public virtual string? Name
5150
{
5251
get => _name;
53-
[param: NotNull]
5452
set
5553
{
5654
Check.NotEmpty(value, nameof(value));
@@ -65,7 +63,7 @@ public virtual string? Name
6563
public virtual string? Schema
6664
{
6765
get => _schema;
68-
[param: CanBeNull] set => _schema = value;
66+
set => _schema = value;
6967
}
7068

7169
/// <summary>

Diff for: src/EFCore.Abstractions/IndexAttribute.cs

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33

44
using System;
55
using System.Collections.Generic;
6+
using System.Diagnostics.CodeAnalysis;
67
using System.Linq;
7-
using JetBrains.Annotations;
88
using Microsoft.EntityFrameworkCore.Utilities;
9-
using CA = System.Diagnostics.CodeAnalysis;
109

1110
namespace Microsoft.EntityFrameworkCore
1211
{
@@ -23,7 +22,7 @@ public sealed class IndexAttribute : Attribute
2322
/// Initializes a new instance of the <see cref="IndexAttribute" /> class.
2423
/// </summary>
2524
/// <param name="propertyNames"> The properties which constitute the index, in order (there must be at least one). </param>
26-
public IndexAttribute([NotNull] params string[] propertyNames)
25+
public IndexAttribute(params string[] propertyNames)
2726
{
2827
Check.NotEmpty(propertyNames, nameof(propertyNames));
2928
Check.HasNoEmptyElements(propertyNames, nameof(propertyNames));
@@ -39,11 +38,11 @@ public IndexAttribute([NotNull] params string[] propertyNames)
3938
/// <summary>
4039
/// The name of the index.
4140
/// </summary>
42-
[CA.DisallowNull]
41+
[DisallowNull]
4342
public string? Name
4443
{
4544
get => _name;
46-
[param: NotNull] set => _name = Check.NotNull(value, nameof(value));
45+
set => _name = Check.NotNull(value, nameof(value));
4746
}
4847

4948
/// <summary>

Diff for: src/EFCore.Abstractions/Infrastructure/ILazyLoader.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ public interface ILazyLoader : IDisposable
3131
/// <param name="navigationName"> The navigation property name. </param>
3232
/// <param name="loaded"> Determines whether the navigation is set as loaded or not. </param>
3333
void SetLoaded(
34-
[NotNull] object entity,
35-
[NotNull] [CallerMemberName] string navigationName = "",
34+
object entity,
35+
[CallerMemberName] string navigationName = "",
3636
bool loaded = true);
3737

3838
/// <summary>
3939
/// Loads a navigation property if it has not already been loaded.
4040
/// </summary>
4141
/// <param name="entity"> The entity on which the navigation property is located. </param>
4242
/// <param name="navigationName"> The navigation property name. </param>
43-
void Load([NotNull] object entity, [NotNull] [CallerMemberName] string navigationName = "");
43+
void Load(object entity, [CallerMemberName] string navigationName = "");
4444

4545
/// <summary>
4646
/// Loads a navigation property if it has not already been loaded.
@@ -53,8 +53,8 @@ void SetLoaded(
5353
#pragma warning disable CA1068 // CancellationToken parameters must come last
5454
Task LoadAsync(
5555
#pragma warning restore CA1068 // CancellationToken parameters must come last
56-
[NotNull] object entity,
56+
object entity,
5757
CancellationToken cancellationToken = default,
58-
[NotNull] [CallerMemberName] string navigationName = "");
58+
[CallerMemberName] string navigationName = "");
5959
}
6060
}

Diff for: src/EFCore.Abstractions/Infrastructure/LazyLoaderExtensions.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ public static class LazyLoaderExtensions
2424
/// The loaded navigation property value, or the navigation property value unchanged if the loader is <see langword="null" />.
2525
/// </returns>
2626
public static TRelated? Load<TRelated>(
27-
[CanBeNull] this ILazyLoader? loader,
28-
[NotNull] object entity,
29-
[CanBeNull] ref TRelated? navigationField,
30-
[NotNull] [CallerMemberName] string navigationName = "")
27+
this ILazyLoader? loader,
28+
object entity,
29+
ref TRelated? navigationField,
30+
[CallerMemberName] string navigationName = "")
3131
where TRelated : class
3232
{
3333
loader?.Load(entity, navigationName);

Diff for: src/EFCore.Abstractions/ObservableCollectionExtensions.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
using System.Collections.ObjectModel;
55
using System.ComponentModel;
6-
using JetBrains.Annotations;
76
using Microsoft.EntityFrameworkCore.ChangeTracking.Internal;
87
using Microsoft.EntityFrameworkCore.Utilities;
98

@@ -21,7 +20,7 @@ public static class ObservableCollectionExtensions
2120
/// <typeparam name="T"> The element type. </typeparam>
2221
/// <param name="source"> The collection that the binding list will stay in sync with. </param>
2322
/// <returns> The binding list. </returns>
24-
public static BindingList<T> ToBindingList<T>([NotNull] this ObservableCollection<T> source)
23+
public static BindingList<T> ToBindingList<T>(this ObservableCollection<T> source)
2524
where T : class
2625
{
2726
Check.NotNull(source, nameof(source));

Diff for: src/EFCore.Abstractions/Properties/AbstractionsStrings.Designer.cs

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: src/EFCore.Cosmos/Diagnostics/CosmosQueryEventData.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ public class CosmosQueryEventData : EventData
2424
/// <param name="querySql"> The SQL representing the query. </param>
2525
/// <param name="logSensitiveData"> Indicates whether or not the application allows logging of sensitive data. </param>
2626
public CosmosQueryEventData(
27-
[NotNull] EventDefinitionBase eventDefinition,
28-
[NotNull] Func<EventDefinitionBase, EventData, string> messageGenerator,
29-
[NotNull] string containerId,
30-
[CanBeNull] string? partitionKey,
31-
[NotNull] IReadOnlyList<(string Name, object? Value)> parameters,
32-
[NotNull] string querySql,
27+
EventDefinitionBase eventDefinition,
28+
Func<EventDefinitionBase, EventData, string> messageGenerator,
29+
string containerId,
30+
string? partitionKey,
31+
IReadOnlyList<(string Name, object? Value)> parameters,
32+
string querySql,
3333
bool logSensitiveData)
3434
: base(eventDefinition, messageGenerator)
3535
{

Diff for: src/EFCore.Cosmos/Diagnostics/CosmosReadItemEventData.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ public class CosmosReadItemEventData : EventData
2222
/// <param name="partitionKey"> The key of the Cosmos partition that the query is using. </param>
2323
/// <param name="logSensitiveData"> Indicates whether or not the application allows logging of sensitive data. </param>
2424
public CosmosReadItemEventData(
25-
[NotNull] EventDefinitionBase eventDefinition,
26-
[NotNull] Func<EventDefinitionBase, EventData, string> messageGenerator,
27-
[NotNull] string resourceId,
28-
[NotNull] string containerId,
29-
[CanBeNull] string? partitionKey,
25+
EventDefinitionBase eventDefinition,
26+
Func<EventDefinitionBase, EventData, string> messageGenerator,
27+
string resourceId,
28+
string containerId,
29+
string? partitionKey,
3030
bool logSensitiveData)
3131
: base(eventDefinition, messageGenerator)
3232
{

Diff for: src/EFCore.Cosmos/Diagnostics/Internal/CosmosLoggerExtensions.cs

+8-9
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using System.Globalization;
77
using System.Linq;
88
using System.Text;
9-
using JetBrains.Annotations;
109
using Microsoft.EntityFrameworkCore.Cosmos.Internal;
1110
using Microsoft.EntityFrameworkCore.Cosmos.Storage.Internal;
1211
using Microsoft.EntityFrameworkCore.Diagnostics;
@@ -31,10 +30,10 @@ public static class CosmosLoggerExtensions
3130
/// doing so can result in application failures when updating to a new Entity Framework Core release.
3231
/// </summary>
3332
public static void ExecutingSqlQuery(
34-
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Database.Command> diagnostics,
35-
[NotNull] string containerId,
36-
[CanBeNull] string? partitionKey,
37-
[NotNull] CosmosSqlQuery cosmosSqlQuery)
33+
this IDiagnosticsLogger<DbLoggerCategory.Database.Command> diagnostics,
34+
string containerId,
35+
string? partitionKey,
36+
CosmosSqlQuery cosmosSqlQuery)
3837
{
3938
var definition = CosmosResources.LogExecutingSqlQuery(diagnostics);
4039

@@ -85,10 +84,10 @@ private static string ExecutingSqlQuery(EventDefinitionBase definition, EventDat
8584
/// doing so can result in application failures when updating to a new Entity Framework Core release.
8685
/// </summary>
8786
public static void ExecutingReadItem(
88-
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Database.Command> diagnostics,
89-
[NotNull] string containerId,
90-
[CanBeNull] string? partitionKey,
91-
[NotNull] string resourceId)
87+
this IDiagnosticsLogger<DbLoggerCategory.Database.Command> diagnostics,
88+
string containerId,
89+
string? partitionKey,
90+
string resourceId)
9291
{
9392
var definition = CosmosResources.LogExecutingReadItem(diagnostics);
9493

Diff for: src/EFCore.Cosmos/Extensions/CosmosDatabaseFacadeExtensions.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5-
using JetBrains.Annotations;
65
using Microsoft.Azure.Cosmos;
76
using Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.Internal;
87
using Microsoft.EntityFrameworkCore.Cosmos.Internal;
@@ -25,7 +24,7 @@ public static class CosmosDatabaseFacadeExtensions
2524
/// </summary>
2625
/// <param name="databaseFacade"> The <see cref="DatabaseFacade" /> for the context. </param>
2726
/// <returns> The <see cref="CosmosClient" /> </returns>
28-
public static CosmosClient GetCosmosClient([NotNull] this DatabaseFacade databaseFacade)
27+
public static CosmosClient GetCosmosClient(this DatabaseFacade databaseFacade)
2928
=> GetService<ISingletonCosmosClientWrapper>(databaseFacade).Client;
3029

3130
private static TService GetService<TService>(IInfrastructure<IServiceProvider> databaseFacade)
@@ -54,7 +53,7 @@ private static TService GetService<TService>(IInfrastructure<IServiceProvider> d
5453
/// </summary>
5554
/// <param name="database"> The facade from <see cref="DbContext.Database" />. </param>
5655
/// <returns> <see langword="true" /> if the Cosmos provider is being used. </returns>
57-
public static bool IsCosmos([NotNull] this DatabaseFacade database)
56+
public static bool IsCosmos(this DatabaseFacade database)
5857
=> database.ProviderName == typeof(CosmosOptionsExtension).Assembly.GetName().Name;
5958
}
6059
}

0 commit comments

Comments
 (0)