dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.96k stars 4.65k forks source link

IConfigurationProvider.GetReloadToken nullable annotation #107470

Open philipborg opened 1 week ago

philipborg commented 1 week ago

Description

The XML-Doc says_ <returns>An <see cref="IChangeToken"/> token if this provider supports change tracking, <see langword="null"/> otherwise.</returns> while the return type annotation claims that it shouldn't return null, directly contradicting the XML-Doc.

Reproduction Steps

Read this https://github.com/dotnet/runtime/blob/d4601d390b6ca9177d62a5ac29b74d30cc16d63d/src/libraries/Microsoft.Extensions.Configuration.Abstractions/src/IConfigurationProvider.cs#L32-L33

Expected behavior

The nullable annotation is consistent with the XML-Doc.

Actual behavior

The nullable annotation contradicts the XML-Doc.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

dotnet-policy-service[bot] commented 1 week ago

Tagging subscribers to this area: @dotnet/area-extensions-configuration See info in area-owners.md if you want to be subscribed.

tarekgh commented 1 week ago

Looking at the implementations of GetReloadToken, this method never returns null. We may need to fix the Xml-doc and the public doc too. The doc of IConfiguration seems correct but the Xml-doc seems not.

@philipborg are you interested to submit a PR to fix the Xml-doc and the public doc too?

philipborg commented 1 week ago

@tarekgh I could make time to fix it sometime during the week.